Text and Numeric Conditions

  • Thread starter Thread starter swaidan
  • Start date Start date
S

swaidan

If I have the following in an excel sheet:

7GH467
8SE65D
59FRS5
6ZSHES

I need a formula that would meet the following conditions:

if the first character is equal to 7 or 8 and the second is a letter to
give me 1.
if the first character is any number other than 7 or 8 and the second
is any letter to give me 2
if the first and second characters are any 2 numbers to give me 3.

Thanks for any help.
 
This evaluates an entry in cell A1:

=IF(ISNUMBER(VALUE(LEFT(A1,2))),3,IF(OR(LEFT(A1,1)="7",LEFT(A1,1)="8"),1,2))

Copy down as far as you need.
 

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