Countifs with OR

Turbo68

Board Regular
Joined
Jan 31, 2014
Messages
118
I have tried to get this done, but for some reason, my CountIfs will not work with OR criteria in the formula. The first 2 will count them fine but line 3, which I thought I had the correct code, doesn't!


=IF(COUNTIFS('MERAKI CSV DATA'!A:A,A208,'MERAKI CSV DATA'!D:D,"MX6*",'MERAKI CSV DATA'!O:O,"=*SEC*")=1,"YES","NO") - WORKS
=IF(COUNTIFS('MERAKI CSV DATA'!A:A,A208,'MERAKI CSV DATA'!D:D,"MX6*",'MERAKI CSV DATA'!O:O,"=*MIN*")=1,"YES","NO") - WORKS

=IF(COUNTIFS('MERAKI CSV DATA'!A:A,A208,'MERAKI CSV DATA'!D:D,"MX6*",'MERAKI CSV DATA'!O:O,{"=*SEC*","=*MIN*"})=1,"YES","NO") - FAILS, will not find either text when i use this.


Any help is greatly appreciated!

Mike
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Try:

=IF(SUM(COUNTIFS('MERAKI CSV DATA'!A:A,A208,'MERAKI CSV DATA'!D:D,"MX6*",'MERAKI CSV DATA'!O:O,{"*SEC*","*MIN*"}))=1,"YES","NO")
 
Upvote 0
You missed the OR from the formula

=IF(OR(COUNTIFS('MERAKI CSV DATA'!A:A,A208,'MERAKI CSV DATA'!D:D,"MX6*",'MERAKI CSV DATA'!O:O,{"=*SEC*","=*MIN*"})=1),"YES","NO")

edit:-

Note that the results of my suggestion will differ from Eric's.

Both will return "YES" if there is 1 *SEC* or 1 *MIN*, if there is 1 of each then Eric's will return "NO", mine will return "YES".
 
Last edited:
Upvote 0
Both will return "YES" if there is 1 *SEC* or 1 *MIN*, if there is 1 of each then Eric's will return "NO", mine will return "YES".
Excellent point. Here's another slight variation:

=IF(SUM(COUNTIFS('MERAKI CSV DATA'!A:A,A208,'MERAKI CSV DATA'!D:D,"MX6*",'MERAKI CSV DATA'!O:O,{"*SEC*","*MIN*"}))>=1,"YES","NO")


This returns "YES" if there is 1 OR MORE of either value.
 
Upvote 0
Thanks, Eric and Jason! I am away from work but will try these out Monday and get back to you. Pretty sure they will work .

Mike
 
Upvote 0

Forum statistics

Threads
1,214,618
Messages
6,120,544
Members
448,970
Latest member
kennimack

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