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?
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
BR
ASKER CERTIFIED SOLUTION
Avatar of Shums Faruk
Shums Faruk
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of BR
BR
Flag of Türkiye image

ASKER

thank you
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

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
BR
Flag of Türkiye image

ASKER

Thank you Rob Henson,
it's a beautiful answer
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo