Count numbers in the same cell

  • Thread starter Thread starter backmara
  • Start date Start date
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)?
 
For comma separated values

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

If this post helps click Yes
 
For comma separated values

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

If this post helps click Yes
 
Basically, you count the commas and add one. This will do it:

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

Hope this helps.

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

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

Hope this helps.

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

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

"backmara" kirjoitti:
 
I'd use:

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

The (A1<>"") will only add 1 if a1 is not empty.
 
I'd use:

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

The (A1<>"") will only add 1 if a1 is not empty.
 
=IF(A1="",0,LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1)

If this post helps click Yes
 
=IF(A1="",0,LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1)

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top