Forum Discussion
COUNTIF formula to exclusively count when all criterias are listed.
- May 03, 2023
MontyKnoll Try this:
=SUM(COUNTIFS(C2:C26,"Group",B2:B26,{"Cold","Room Temp"}))
or use a pivot table.
MontyKnoll Try this:
=SUM(COUNTIFS(C2:C26,"Group",B2:B26,{"Cold","Room Temp"}))
or use a pivot table.
Nevermind. Your formula worked perfectly in my pretend yoga spreadsheet but for my actual spreadsheet not so much. Formula comes up with 0 everytime and there are red brackets in my formula. Could you let me know what i'm doing wrong?
Thank you so much.
- Riny_van_EekelenMay 03, 2023Platinum Contributor
Can't tell without seeing the workbook. Sorry. Are you sure that everything is spelled correctly? Leading or trailing spaces may mess up things pretty badly.
- MontyKnollMay 04, 2023Copper Contributor
No problem! I found out that for some reason the formula didn't work when the data was in a different sheet than the formula (even though I did the Sheet2! before the range criteria). So I've kept the data and summary in the same sheet and it seems to be working!
By the way yes one formula had a problem with a hidden space at the end so instead of typing out the criteria i'm just going to copy paste each time.
Let me know if you might know why your formula may not work between 2 different sheets.
Thank you so much for your help.