Sumifs works under certain conditions

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,603
Office Version
  1. 2021
Platform
  1. Windows
I have the following sumifs formula which gives me the correct result

Code:
 =SUM(SUMIFS(C:C,B:B,({"*lab mon*","*lab fast*"})))


However if I use the following formula , it returns zero

Code:
 =SUMIFS(C:C,B:B,"*lab mon*",B:B,"*lab fast*")


It would be appreciated if someone can assist me
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
The second formula simply has the wrong syntax for what you are trying to achieve. That formula is looking for rows that have both "*lab mon*" and "*lab fast*" on the same row in column B, whereas you appear to be looking for "*lab mon*" or "*lab fast*" in column B.

It would be appreciated if someone can assist me
Since you already have a formula that returns the correct value, in what way do you need help?
 
Last edited:
Upvote 0
Hi Peter

I was trying to find out why the second formula was not working i.e returning zero
 
Upvote 0
Thanks it did


I am try to add values in Col C where "*lab mon*" and "*lab fast*" appears in Col B
 
Upvote 0
I am try to add values in Col C where "*lab mon*" and "*lab fast*" appears in Col B
If the first formula works, then, no, you are trying to add values in Col C where "*lab mon*" or "*lab fast*" appears in Col B
 
Upvote 0
Thanks, How to I amend the second formula to give the same result ?
 
Upvote 0
Thanks, How to I amend the second formula to give the same result ?
This brings me back to my earlier question. Why bother when you (apparently) have a perfectly good formula producing the result you want?

However:

=SUMIF(B:B,"*lab mon*",C:C)+SUMIF(B:B,"*lab fast*",C:C)

Note that this formula, and your original one, will double-count a row if a cell in column B contains both "*lab mon*" and "*lab fast*".
 
Upvote 0
You are 100% correct. If solution works why bother
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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