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.
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.
One option is to use the following formula:
=COUNT(SPLIT(A1; ","))
Here's an example:
Just so it is not missed when counting non-numeric items (thanks @noway and @wchiquito as count did not work for my text)
=COUNTA(SPLIT(A1,","))
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))