Using IF with CONTAINS and AND for multiple columns
I am looking at two different columns - one is called Status and the other Priority. I would like to have a formula/function setup that will look for "Open" within the Status column and "High" within the Priority column. If it finds "Open" and "High" together in any row, I want a "True" value returned. This will be used in a sheet summary. So far, I have
=IF(CONTAINS(AND("Open", Status:Status), ("High", Priority:Priority)), "True", "False"). This gets me an #UNPARSABLE error.
I'm stuck. Please help.🙂
Best Answer
-
Use a COUNTIFS inside of the IF. First the COUNTIFS will generate a count of how many rows match your range/criteria sets. Then you use the IF to say that if the countifs output is greater than zero, output "True", otherwise "False".
=IF(COUNTIFS(Status:Status, @cell = "Open", Priority:Priority, @cell = "High") > 0, "True", "False")
Answers
-
Use a COUNTIFS inside of the IF. First the COUNTIFS will generate a count of how many rows match your range/criteria sets. Then you use the IF to say that if the countifs output is greater than zero, output "True", otherwise "False".
=IF(COUNTIFS(Status:Status, @cell = "Open", Priority:Priority, @cell = "High") > 0, "True", "False")
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.5K Get Help
- 424 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 145 Just for fun
- 63 Community Job Board
- 465 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 301 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!