SUMIFS Formula with OR Criteria

Weasel

Board Regular
Joined
Sep 13, 2005
Messages
58
Is there a way to use the SUMIFS formula and include an OR criteria. As an example, if I wanted to SUM any cell in column B if in column A the corresponding row contained the criteria of the number 10 or 20 is it possible? The only way I can figure out how to currently do it is two SUMIF formula's added together with each separate criteria. I know you can accomplish this by using a SUMPRODUCT formula was wondering if it can be done using SUMIFS. Thanks in advance for any help.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Here are a few options using regular formulas...

Embedding the criteria:
=SUM(SUMIFS(B1:B10,A1:A10,{10,20}))
or
=SUM(SUMIF(A1:A10,{10,20},B1:B10))

Referencing the criteria:
F1: 10
F2: 20

=SUMPRODUCT(SUMIFS(B1:B10,A1:A10,F1:F2))
or
=SUMPRODUCT(SUMIF(A1:A10,F1:F2,B1:B10))

EDITED TO INCLUDE THIS NON-SUMIF(S) ALTERNATIVE:
=SUMPRODUCT((COUNTIF(F1:F2,A1:A10)>0)*B1:B10)

Does that help?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,946
Latest member
JoseDavid

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