SumIfs(or)?

Reddog94

Board Regular
Joined
Dec 20, 2011
Messages
52
Can an OR function be imbedded in a SumIfs function? For example, I want to do a SumIfs with two criteria, however the second criteria could be 3 different values.

For example,

Column 1 = department number
Column 2 = expense category
Column 3 = data to be summed

I want to sum all data in column 3 if column 1 = "1234" and column 2 = either "labor", "fringe", or "merit".

Using Excel 2007.
Thank you.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Can an OR function be imbedded in a SumIfs function? For example, I want to do a SumIfs with two criteria, however the second criteria could be 3 different values.

For example,

Column 1 = department number
Column 2 = expense category
Column 3 = data to be summed

I want to sum all data in column 3 if column 1 = "1234" and column 2 = either "labor", "fringe", or "merit".

Using Excel 2007.
Thank you.
Try this...

=SUM(SUMIFS(C1:C10,A1:A10,1234,B1:B10,{"labor","fringe","merit"}))
 
Upvote 0
This will work:
=SUMPRODUCT((C2:C10)*(A2:A10=1234)*ISNUMBER(SEARCH({"labor","fringe","merit"},B2:B10,1)))
 
Upvote 0
Yes - awesome, thank you! I really need to spend some time discoving the value of array formulas...
 
Upvote 0
To clarify, I used the first solution posted by Biff. The second solution posted worked too, however I tend to avoid SumProduct formulas as I find they bog down my files. Thanks to both of you!
 
Upvote 0
To clarify, I used the first solution posted by Biff. The second solution posted worked too, however I tend to avoid SumProduct formulas as I find they bog down my files. Thanks to both of you!
Yes, I have experienced this too and read sometimes here as well but haven't got any clue as why do they tend to be slow :confused:.

It was just that I had worked it out so decided to post it anyway. Thank you for your feedback.
 
Upvote 0
To clarify, I used the first solution posted by Biff. The second solution posted worked too, however I tend to avoid SumProduct formulas as I find they bog down my files. Thanks to both of you!
You're welcome. We appreciate the feedback! :cool:
 
Upvote 0
Can cell references and wildcards be used in the array? I'm trying to do SUMIFS if a column of text contains the full word only. For example, finding "ship" in these cells:

"cruise ship" = TRUE
"spaceship" = FALSE
"shipping" = FALSE

=SUM(SUMIFS(sum_range, criteria_range, {"* ship *", "* ship", "ship *"}))
Works, but I'm looking for a dynamic version.

=SUM(SUMIFS(sum_range, criteria_range, {"* "&A1&" *", "* "&A1, A1&" *"}))
Causes a formula error.
 
Upvote 0
Can cell references and wildcards be used in the array? I'm trying to do SUMIFS if a column of text contains the full word only. For example, finding "ship" in these cells:

"cruise ship" = TRUE
"spaceship" = FALSE
"shipping" = FALSE

=SUM(SUMIFS(sum_range, criteria_range, {"* ship *", "* ship", "ship *"}))
Works, but I'm looking for a dynamic version.

=SUM(SUMIFS(sum_range, criteria_range, {"* "&A1&" *", "* "&A1, A1&" *"}))
Causes a formula error.
No, you can't use cell references in an array constant.

Try it like this:

Book1
ABCD
1Ship_Ship77
2214_Shipment80
3___17
4__shipping34
5__spaceship88
6__cruise ship86
7__Robert Shipley16
8__Ship Ahoy51
9__Text93
Sheet1

This formula entered in A2:

=SUMPRODUCT(--ISNUMBER(SEARCH(" "&A1&" "," "&C1:C9&" ")),D1:D9)
 
Upvote 0
=SUMPRODUCT(--ISNUMBER(SEARCH(" "&A1&" "," "&C1:C9&" ")),D1:D9)

" "&A1&" "
How is the criteria above picking up "ship x" "x ship" and " ship "? The way it's written seems like only " ship " would calculate.

" "&C1:C9&" "
Why are the space appendings necessary for the search range?

Why is -- necessary?

Exactly what I need. Thank you Biff!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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