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
Check out the Formula Handbook template!