Multiple CONTAINS statements error
I am trying to count multiple criteria using a COUNTIFS formula that also has a CONTAINS statement, which works fine until I add a 2nd CONTAINS statement. The detailed data lives in a different sheet.
Fields are Org = Org Code (one of about 30); WS = Workstream (Sales, Finance, HR, etc.); Roles = UAT Tester, SME, Power User, etc.).
Roles has always been a multi-select field, so it could have UAT Tester and SME as values. Workstream was a single-select dropdown when my working formula was written. It has recently been changed to a multi-select allowing Finance and Sales to be selected. This is what broke the formula. If it has Finance and Sales (multiple workstreams) the formula fails.
I tried adding a second CONTAINS statement, which returns a INCORRECT ARGUMENT SET error.
Working formula (if only 1 workstream present):
=COUNTIFS({Org}, "AOC:CLAR:CLAR", {WS}, ("Finance"), {Roles}, CONTAINS("UAT Tester", @cell))
Broken formula (when multiple workstreams present):
=COUNTIFS({Org}, "AOC:CLAR:CLAR", {WS}, CONTAINS("Finance"), {Roles}, CONTAINS("UAT Tester", @cell))
Can you help me to get a second CONTAINS statement added to get this to properly count? Thank you in advance.
Best Answer
-
Try using the same syntax as the other CONTAINS.
CONTAINS("specific text", @cell)
Answers
-
Try using the same syntax as the other CONTAINS.
CONTAINS("specific text", @cell)
-
Paul, Absolutely brilliant. Simple fix but I couldn't have done it without you. Many thanks!
-
Happy to help. 👍️
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
- 497 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!