Number of digits problem

J

James8309

Hi everyone

I have this number in Cell A1 = 6190099009

Obviously " =Len(A1) will return 10, =Left(A1,1) will return 6.

If I combine this conditions together: (Return "True" if it starts
with 6 and if it is 10digits.
=if(and(Len(A1)="10",Left(A1,1)="6"),"True","False")

However, it returns "FALSE". Why does it return false when I join them
by "AND"???

Please Help

Thank you.
 
P

pub

=if(and(Len(A1)="10",Left(A1,1)="6"),"True","False")

the problem is with your quotes

=IF(AND(LEN(A1)=10,LEFT(A1,1)="6"),TRUE,FALSE)

the len(a1)="10" was producing your false

look closeley at how excel was defaulting your len() formula and your left
() formula on a default formatted sheet.
 
P

Paul Hyett

Hi everyone

I have this number in Cell A1 = 6190099009

Obviously " =Len(A1) will return 10, =Left(A1,1) will return 6.

If I combine this conditions together: (Return "True" if it starts
with 6 and if it is 10digits.
=if(and(Len(A1)="10",Left(A1,1)="6"),"True","False")

However, it returns "FALSE". Why does it return false when I join them
by "AND"???

Please Help

Thank you.

This seems to work :

=IF(AND(LEN(A1)=10,VALUE(LEFT(A1,1))=6),"True","False")
 
D

Dana DeLouis

=if(and(Len(A1)=10,Left(A1,1)=6),"True","False")

Hi. You have a solution.
If you would like an alternative...
Note that this returns a Boolean True/False, and not your string "True" or "False"

=QUOTIENT(A1,1E9)=6

--
Dana DeLouis
 

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

Top