IF statement needed

  • Thread starter Thread starter Connie Martin
  • Start date Start date
C

Connie Martin

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
 
Try this:

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

Hope this helps.

Pete
 
Luke, Pete and David, thank you so much! You all had the same answer and it
works fabulously. Connie
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top