Contains with Multiselect column
I have a column that is multiselect for our systems. The values in this column are X, Xi, S, SP and a few others. I am trying to count the number of rows where the value "X" is selected. Sometimes it may be only X, other times the column value may have both X and Xi. When i use contains, it is counting everything in the string, so it includes all the instances of Xi as well as X.
I've tried multiple approaches, but am stuck. Any help would be most appreciated. This was the original formula I tried.
=COUNTIF({Platform}, CONTAINS("X", @cell))
Best Answer

This was tricky. Try this =COUNTIF({Platform}, IF(HAS(@cell, "X"), "true", "false") = "true")
This is essentially counting each cell and marking it as true if it contains exactly an "X"
Answers

Hi Lynn
Try HAS instead of CONTAINS. HAS is an exact match function. Note the syntax is different.
=COUNTIF({Platform}, HAS(@cell, "X"))

This was tricky. Try this =COUNTIF({Platform}, IF(HAS(@cell, "X"), "true", "false") = "true")
This is essentially counting each cell and marking it as true if it contains exactly an "X"

Thank you so much for this suggestion. I had tried HAS, but Mike's answer below was spot on. Really appreciate you reviewing my question and reaching out!

Instead of using CONTAINS, try OR(@cell = "X", @cell = "Xi")
=COUNTIF({Platform}, OR(@cell = "X", @cell = "Xi"))

thanks for responding, this was not quite what i needed, but Mike answered the question and that formula worked!
Help Article Resources
Categories
 All Categories
 14 Welcome to the Community
 Smartsheet Customer Resources
 62.3K Get Help
 364 Global Discussions
 199 Industry Talk
 428 Announcements
 4.4K Ideas & Feature Requests
 136 Brandfolder
 127 Just for fun
 128 Community Job Board
 445 Show & Tell
 28 Member Spotlight
 1 SmartStories
 283 Events
 35 Webinars
 7.3K Forum Archives
Check out the Formula Handbook template!