Formula: Yes or No IF cell contains one of two letters

R

RaveMonkey

Hi,

I am trying to create a formula that will check a cell to see if i
contains one of two letters followed by three numbers. If this is tru
I want the word Yes returned and No if not.

Example Data:

A B

D123 Yes
N456 Yes
STN0356 No
NK592269 No

In these examples D123 and N456 would return a Yes and the others
No.

Suggestions?

RaveMonke
 
G

Guest

Hi

Quick and dirty!
Try something like this:
=IF(AND(LEN(A2)=4,ISNUMBER(N(RIGHT(A2,3))),NOT(ISNUMBER(LEFT(A2,1)))),"Yes",
"No")
There are probably nicer ways of doing it!!
 
J

Jerry W. Lewis

=IF((LEN(A1)=4)*LEN(VALUE(RIGHT(A1,3)))*ISNUMBER((FIND(LEFT(A1,1),"DN"))),"Yes","No")

Jerry
 

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

Top