Help

Counting number of commas in one string

2176 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Jeffrey_Tufenki
4 - Data Explorer
4 - Data Explorer

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!

1 Reply 1
augmented
10 - Mercury
10 - Mercury

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!