sumifs using list of cells as critera

joshman108

Active Member
Joined
Jul 6, 2016
Messages
310
As opposed to doing something like this:

Rich (BB code):
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px 'Helvetica Neue'; color: #323333 ; -webkit-text-stroke: #323333 }span.s1 {font-kerning: none}</style>=sumifs(C:C,B:B,"<>fbk",B:B,"<>ofb")

I would like to basically do something like this:

Rich (BB code):
=sumifs(C:C,B:B,<>d1:d4)

where d1:d4 holds a list of things I want to exclude.

Is this possible at all? Haven't found an answer online. Thanks
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px 'Helvetica Neue'; color: #323333 ; -webkit-text-stroke: #323333 }span.s1 {font-kerning: none}</style>
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi, here is another option you can try, note - you should avoid using full column references with this type of formula.

=SUMPRODUCT(1-ISNUMBER(MATCH(B2:B100,D1:D4,0)),C2:C100)
 
Last edited:
Upvote 0
FormR, that works beautifully. I love it.

Jonmo1, that works as well, but can you explain how SUMIF(B:B,D1:D4,C:C) returns the proper arguments for sumproduct? I don't understand how that works as sumproduct takes 2 range arguments.
 
Upvote 0
as sumproduct takes 2 range arguments.
That's an incorrect assumption.

You can certainly enter only 1 range argument in sumproduct, like =SUMPRODUCT(A1:A10), or even just SUMPRODUCT(A1)
However, it will only behave as a SUM, there will be no 'Product' function occuring.

So the sumif creates an array of of results, 1 for each cell in D1:D4
Like {SUMIF(B:B,D1,C:C),SUMIF(B:B,D2,C:C),SUMIF(B:B,D3,C:C),SUMIF(B:B,D4,C:C)}

Then sumproduct sums that array.
 
Last edited:
Upvote 0
Wow, thanks for explaining. So is creating an array inherent to sumif then? Sumifs does not do the same thing does it?
 
Upvote 0
That way would really only do the D1 value.
You need SUMPRODUCT to force it to process the Array of results.
OR you could use SUM and enter it as an array by pressing CTRL+SHIFT+ENTER
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top