How can I count the number of comma separated numbers in a google spreadsheet?

Viewed 26824

I've got a cell which has values 1,2,3,4

I need a formula that returns 4 in another cell, however this Google spreadsheet looks really complicated. Also I need to trim because I might have white spaces between the numbers.

4 Answers

I came a bit late to the party, but: if you want to count 0 when there is nothing in the cell...

=COUNTA(SPLIT(A1, ",")) - NOT(LEN(A1))

Related