ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF statement needed (https://www.excelbanter.com/excel-worksheet-functions/169173-if-statement-needed.html)

Connie Martin

IF statement needed
 
How would I write this IF statement:
If C2 begins with 4 put "P", if C2 begins with 7 put "S", otherwise put
nothing?

Thank you so much. Connie

Pete_UK

IF statement needed
 
Try this:

=IF(LEFT(C2,1)="4","P",IF(LEFT(C2,1)="7","S",""))

Hope this helps.

Pete

On Dec 10, 8:35 pm, Connie Martin
wrote:
How would I write this IF statement:
If C2 begins with 4 put "P", if C2 begins with 7 put "S", otherwise put
nothing?

Thank you so much. Connie



David Biddulph[_2_]

IF statement needed
 
=IF(LEFT(C2)="4","P",IF(LEFT(C2)="7","S",""))
--
David Biddulph

"Connie Martin" wrote in message
...
How would I write this IF statement:
If C2 begins with 4 put "P", if C2 begins with 7 put "S", otherwise put
nothing?

Thank you so much. Connie




Luke M

IF statement needed
 
This should do it.

=IF(LEFT(C2,1)="4","P",IF(LEFT(C2,1)="7","S",""))

--
Best Regards,

Luke M


"Connie Martin" wrote:

How would I write this IF statement:
If C2 begins with 4 put "P", if C2 begins with 7 put "S", otherwise put
nothing?

Thank you so much. Connie


Connie Martin

IF statement needed
 
Luke, Pete and David, thank you so much! You all had the same answer and it
works fabulously. Connie

"Connie Martin" wrote:

How would I write this IF statement:
If C2 begins with 4 put "P", if C2 begins with 7 put "S", otherwise put
nothing?

Thank you so much. Connie


Luke M

IF statement needed
 
Your welcome. Thanks for the feedback!
--
Best Regards,

Luke M


"Connie Martin" wrote:

Luke, Pete and David, thank you so much! You all had the same answer and it
works fabulously. Connie

"Connie Martin" wrote:

How would I write this IF statement:
If C2 begins with 4 put "P", if C2 begins with 7 put "S", otherwise put
nothing?

Thank you so much. Connie


David Biddulph[_2_]

IF statement needed
 
You're welcome, Connie. I'd made it slightly shorter by using just
LEFT(C2), rather than LEFT(C2,1), but the result should be the same.
--
David Biddulph

"Connie Martin" wrote in message
...
Luke, Pete and David, thank you so much! You all had the same answer and
it
works fabulously. Connie

"Connie Martin" wrote:

How would I write this IF statement:
If C2 begins with 4 put "P", if C2 begins with 7 put "S", otherwise put
nothing?

Thank you so much. Connie





All times are GMT +1. The time now is 02:31 AM.

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