Link to home
Create AccountLog in
Avatar of BR
BRFlag for Türkiye

asked on

simple excel formula

Dear Experts,

=IF(LEFT(D2;1)=5;TRUE;FALSE)

I want to check, if the first letter of D1 is 5, I want to write TRUE otherwise FALSE

what is wrong with my formula?
ASKER CERTIFIED SOLUTION
Avatar of Shums Faruk
Shums Faruk
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of BR

ASKER

thank you
The reason why your original was not working is probably because the contents of D1 are text rather than a number. Eventhough you are only looking at the first character and it is a number the fact that it has come from a text string it will be recognised as text.

If you want literally just a TRUE or FALSE result you don't need the IF statement:

=LEFT(D2;1)="5"

Thanks
Rob
Avatar of BR

ASKER

Thank you Rob Henson,
it's a beautiful answer