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
- 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
- 495 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!