SUMIFS using an OR operator

miconian

Well-known Member
Joined
Aug 18, 2004
Messages
769
Basically, I'm using SUMIFS, and the final criterion could go one of two ways: either EMER or APPC are valid values.

Here's my formula:

=SUMIFS(Data2011[Net Amount],Data2011[Internet Site],A13,Data2011[Confidence %],"B",Data2011[Ad Unit],"EMER")

The last criterion, Data2011[Ad Unit],"EMER" is correct, but incomplete. Another valid criteria for [Ad Unit] should be "APPC".

So I'm trying to do something like this:

=SUMIFS(Data2011[Net Amount],Data2011[Internet Site],A13,Data2011[Confidence %],"B",Data2011[Ad Unit],"EMER" OR Data2011[Ad Unit],"APPC")

or perhaps:

SUMIFS(Data2011[Net Amount],Data2011[Internet Site],A13,Data2011[Confidence %],"B",OR((Data2011[Ad Unit],"EMER"),(Data2011[Ad Unit],"APPC"))

What am I missing?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try adding two separate SUMIFS statements together:


=SUMIFS(Data2011[Net Amount],Data2011[Internet Site],A13,Data2011[Confidence %],"B",Data2011[Ad Unit],"EMER")+
SUMIFS(Data2011[Net Amount],Data2011[Internet Site],A13,Data2011[Confidence %],"B",Data2011[Ad Unit],"APPC")
 
Upvote 0
Try:

=SUM(SUMIFS(Data2011[Net Amount],Data2011[Internet Site],A13,Data2011[Confidence %],"B",Data2011[Ad Unit],{"EMER","APPC"}))
 
Upvote 0
Except, Andrew, it doesn't work. It only picks up on the first item in the array. Took me a while to realize why it wasn't working in some cases; those were the cases where the data for Ad Unit was the second array item. When I switched it to the first, the formula worked.
 
Upvote 0
Okay. Suppose you enter the following data in the fifteen upper-left-most cells on a worksheet, starting with "site" in cell A1:

Code:
site     product     money
CNN     red          10
ABC     blue         15
CBS     green        25
NBC     yellow       67

And then, on the same worksheet, enter these two formulas in any cells:

=SUMIFS(C2:C5,A2:A5,"CNN",B2:B5,{"red","orange"})
=SUMIFS(C2:C5,A2:A5,"CNN",B2:B5,{"orange","red"})

The first formula will return 10. The second will return 0.
 
Upvote 0
The equivalent of my formula would be:

=SUM(SUMIFS(C2:C5,A2:A5,"CNN",B2:B5,{"red","orange"}))
=SUM(SUMIFS(C2:C5,A2:A5,"CNN",B2:B5,{"orange","red"}))

both of which return 10.
 
Upvote 0
Oh. Yes, I had missed that part.

Could you please explain how it works? What does it mean to sum a sumifs?
 
Upvote 0

Forum statistics

Threads
1,214,615
Messages
6,120,538
Members
448,970
Latest member
kennimack

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