How to count elements in a comma separated list?
I am trying to write a formula to count the number of elements contained in a comma separated list in a single cell. I am new to Smartsheet and have tried using several functions with no luck. I know I am missing something but have not been able to figure it out.
Best Answer
-
Insert a multi-select dropdown column. Then we can insert a formula to substitute the comma with a line break. Once that is in place, you can use a COUNTM function to count how many options are "selected" in the multi-select column.
Formula for multi-select column:
=SUBSTITUTE([Text Column]@row, ",", CHAR(10))
Formula to get count:
=COUNTM([Multi-Select Column]@row)
Answers
-
Insert a multi-select dropdown column. Then we can insert a formula to substitute the comma with a line break. Once that is in place, you can use a COUNTM function to count how many options are "selected" in the multi-select column.
Formula for multi-select column:
=SUBSTITUTE([Text Column]@row, ",", CHAR(10))
Formula to get count:
=COUNTM([Multi-Select Column]@row)
-
Thanks, Paul! That works!
-
Happy to help. 👍️
Help Article Resources
Categories
Check out the Formula Handbook template!