Counting number of commas in one string

Hey guys, first thank you for taking your time to read my question! I have a column where there could be from 0 to infinity amount of “Strings”, these look like this “, 20457-268, 28649-882, 28964-2899”. As you can see it starts with a Comma and every set of numbers (divided by a dash) represents something to me. Based on the given example, I’m trying to find a formula that will give me a number of the “Strings” you see, for the example I provided it should give me a 3.

Since the numbers change and I have no control over them, and the last number never ends in a comma, I figured all I have to do is Count the commas, in the example given as you can see it starts with a Comma and the comma itself separates each string and the count should be 3 because it has 3 commas.

Can anyone help me with this formula? Many thanks in advance!

Hi Jeffrey. That should be pretty easy. Give this a try…

LEN({column name})-LEN(SUBSTITUTE({column name}, ',', ''))

Let us know if that’s what you are after!

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.