SUMIFS Formula with OR

rsmeyerson

Board Regular
Joined
Nov 29, 2014
Messages
104
Hi,

I am trying to create a SUMIFS formula that will work if a specific criteria is present in either of two cells (B35 OR B36). The following formula works when a criteria is present in a single cell but I'm having trouble adjusting this formula.

=SUMIFS(Sheet1!D:D,Sheet1!A:A,B35,Sheet1!B:B,"New")


Thanks for your help.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Let's assume that you want the word "Red" to be your criteria that must be present.

Then try this formula;

=IF(B35="Red",SUMIFS(Sheet1!D:D,Sheet1!A:A,B35,Sheet1!B:B,"New"),IF(B36="Red",SUMIFS(Sheet1!D:D,Sheet1!A:A,B36,Sheet1!B:B,"New"),""))

If neither one has the correct criteria, it will leave it blank...
 
Upvote 0
=SUMPRODUCT(SUMIFS(Sheet1!D:D,Sheet1!A:A,B35:B36,Sheet1!B:B,"New"))

or, using definite ranges instead of whole columns...

=SUMPRODUCT(Sheet1!D2:D1000,--ISNUMBER(MATCH(Sheet1!A2:A1000,B35:B36,0)),--(Sheet1!D2:D1000="New"))

or, given your wording of OR...

=SUMIFS(Sheet1!D:D,Sheet1!A:A,IF(B35="",B36,B35),Sheet1!B:B,"New")
 
Last edited:
Upvote 0
=SUMPRODUCT(SUMIFS(Sheet1!D:D,Sheet1!A:A,B35:B36,Sheet1!B:B,"New"))

or, using definite ranges instead of whole columns...

=SUMPRODUCT(Sheet1!D2:D1000,--ISNUMBER(MATCH(Sheet1!A2:A1000,B35:B36,0)),--(Sheet1!D2:D1000="New"))

or, given your wording of OR...

=SUMIFS(Sheet1!D:D,Sheet1!A:A,IF(B35="",B36,B35),Sheet1!B:B,"New")


Since adding your SUMIFS formula above, my excel spreadsheet is lagging and running extremely slowly. I also added this formula to many of the sheets: =IF(ISNUMBER(LOOKUP(9.99999999999999E+307,MATCH(B171:B172,'[SheetName.xlsm]Sheet1'!A:A, 0))),"","Adj New:"). Any idea if these formulas might be causing this? Is there a way to speed it up? Thanks.
 
Upvote 0
Since adding your SUMIFS formula above, my excel spreadsheet is lagging and running extremely slowly. I also added this formula to many of the sheets: =IF(ISNUMBER(LOOKUP(9.99999999999999E+307,MATCH(B171:B172,'[SheetName.xlsm]Sheet1'!A:A, 0))),"","Adj New:"). Any idea if these formulas might be causing this? Is there a way to speed it up? Thanks.

That's possible. Try to replace the hole column references with definite ones, that is, e.g., A:A >> A2:A2000 etc.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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