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
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!