ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple if statment just not coming to me (https://www.excelbanter.com/excel-programming/432707-simple-if-statment-just-not-coming-me.html)

Nelson

Simple if statment just not coming to me
 
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

--
Nelson

Sam Wilson

Simple if statment just not coming to me
 
=IF(LEFT(C2,3)="ABC","Yes","No")

"Nelson" wrote:

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

--
Nelson


Nelson

Simple if statment just not coming to me
 
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






--
Nelson


"Sam Wilson" wrote:

=IF(LEFT(C2,3)="ABC","Yes","No")

"Nelson" wrote:

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

--
Nelson


Sam Wilson

Simple if statment just not coming to me
 
=IF(LEFT(A1,3)="ABC","Yes ABC",IF(LEFT(A1,3)="DEF","Yes DEF","No"))

"Nelson" wrote:

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






--
Nelson


"Sam Wilson" wrote:

=IF(LEFT(C2,3)="ABC","Yes","No")

"Nelson" wrote:

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

--
Nelson


Rick Rothstein

Simple if statment just not coming to me
 
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")

--
Rick (MVP - Excel)


"Nelson" wrote in message
...
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






--
Nelson


"Sam Wilson" wrote:

=IF(LEFT(C2,3)="ABC","Yes","No")

"Nelson" wrote:

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

--
Nelson




All times are GMT +1. The time now is 03:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com