COUNTIF and CONTAINS and OR
I have 2 columns that have multiple select drop down options. I want to create a formula that allows me to identify a PLO and then count the number of times "BE" OR "BC" OR "BL" or "BM" appear throughout the entire sheet.
so:
=COUNTIF([PLO Alignment]:[PLO Alignment], CONTAINS("A.1 Environment",@cell), Sections:Sections, CONTAINS("BE",@cell))
will identify the PLO A.1 Environment, and find the "BE" and count it... but how do I add the other options?
Thanks!
Kelly
Best Answer
-
Your OR should be part of your last criteria:
=COUNTIF([PLO Alignment]:[PLO Alignment], CONTAINS("A.1 Environment",@cell), Sections:Sections, OR(CONTAINS("BE",@cell), CONTAINS("BC",@cell), CONTAINS("BL",@cell), CONTAINS("BM",@cell)))
Note: If BC / BE / BL / BM are the only options with a "B", you could also use:
=COUNTIF([PLO Alignment]:[PLO Alignment], CONTAINS("A.1 Environment",@cell), Sections:Sections, FIND("B", @cell)>0)
Hope it helped!
Answers
-
Your OR should be part of your last criteria:
=COUNTIF([PLO Alignment]:[PLO Alignment], CONTAINS("A.1 Environment",@cell), Sections:Sections, OR(CONTAINS("BE",@cell), CONTAINS("BC",@cell), CONTAINS("BL",@cell), CONTAINS("BM",@cell)))
Note: If BC / BE / BL / BM are the only options with a "B", you could also use:
=COUNTIF([PLO Alignment]:[PLO Alignment], CONTAINS("A.1 Environment",@cell), Sections:Sections, FIND("B", @cell)>0)
Hope it helped!
-
YAY! It is COUNTIFS, both work and the second one is much easier to work with. Thank you!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!