Count numbers in the same cell

B

backmara

I need to know how many numbers are in the same cell.
Example:
A1 inculdes 12,23,34,45
How I calculating this numbers(Answer:4)?
 
J

Jacob Skaria

For comma separated values

=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1

If this post helps click Yes
 
P

Pete_UK

Basically, you count the commas and add one. This will do it:

=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1

Hope this helps.

Pete
 
B

backmara

Thanks gyus;
this works: =LEN(A1)-LEN(SUBSTITUTE(A1;",";""))+1

"backmara" kirjoitti:
 
D

Dave Peterson

I'd use:

=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+(A1<>"")

The (A1<>"") will only add 1 if a1 is not empty.
 
J

Jacob Skaria

=IF(A1="",0,LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1)

If this post helps click Yes
 
Top