# LEN Function, count number of Numbers in a cell, but count if are 12 numbers the most..

1. ## LEN Function, count number of Numbers in a cell, but count if are 12 numbers the most..

Hi,

Merry Christmas !!!

please i need some help on =LEN function

On daily basis I Have a groups of Numbers On Cell G4 to G109

FOR EXAMPLE

On Cell H4 I input the len function as =LEN(G4)

And this function count each Digit plus the character "-"

EXAMPLE what im getting (i don't want this)

IncorrectLEN.png

What i need is to count just the Numbers, not the character "-"

Also i tryed others LEN Functions and didn't work for me

e.i

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

Example what i do need (desired output)

DesireOutput.png

Thanks

David

Best Regards from Miami.  Register To Reply

2. ## Re: LEN Function, count number of Numbers in a cell, but count if are 12 numbers the most.

Try this:

=(LEN(G4)+1)/3

- Moo  Register To Reply

3. ## Re: LEN Function, count number of Numbers in a cell, but count if are 12 numbers the most.

And the seasons greetings to you too.

If the numbers are always in pairs then

=LEN(SUBSTITUTE(A1,"-",""))/2  Register To Reply

4. ## Re: LEN Function, count number of Numbers in a cell, but count if are 12 numbers the most.

=if(g4="","",len(g4)-len(substitute(g4,"-",""))+1)  Register To Reply

5. ## Re: LEN Function, count number of Numbers in a cell, but count if are 12 numbers the most.

Hi Mr Moo,

Yes it work as i need !!

Thanks !!!

p.s
Wow, the ")/3" .... give me a hard time... ji ji ji   Register To Reply

6. ## Re: LEN Function, count number of Numbers in a cell, but count if are 12 numbers the most.

Hi David!

Logic is that despite you not wanting to count the "-", you'll get the number of your numbers using:

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

Seems to work OK on your data.

Hope that helps more than it confuses.

Norman Harker  Register To Reply

7. ## Re: LEN Function, count number of Numbers in a cell, but count if are 12 numbers the most.

Hi, !!

Wow, i trying since this morning i'm trying to solve the LEN thinghi, and let me tell you guys

all of the Formulas you posted work!!

Thank you all !!! Richard, Marting, Norman .....   Register To Reply