Simple if statment just not coming to me

N

Nelson

Working to hard and cant figure out this

in cell H2 - If cell (c2) begins with ABC then state "yes" if not state "no"

Sorry I know its simple but for some reason its not coming to me

Thanks in advance for your help
 
N

Nelson

THANKS, however now I have a follow up if I may

I need to add another variable

so if C2 begins with ABC say "YES ABC" if it begins with DEF say "Yes DEF"
anything else say "NO"

How would that work, I tried ORs but again its not coming to me?

Thanks in advanvce
 
R

Rick Rothstein

Give this a try...

=IF(OR(LEFT(A1,3)={"ABC","DEF"}),"Yes "&A1,"No")

If you can enter lower or mixed case "ABC" and/or "DEF", and if you always
want upper case "ABC" and/or "DEF" following the word "Yes", then use this
instead...

=IF(OR(LEFT(A1,3)={"ABC","DEF"}),"Yes "&UPPER(A1),"No")
 
Top