if statement for number of digits

P

Pam M

I need help writing an if statement. I would like to say:

If(A1 = a 4 digit number,"UNAPPROVED","")

How do I designate the 4 digit number in the formula?

Also, for another statement, I want to say "begins with 4, 5, 6, or 9, give
me "","unapproved".

Thanks,Pam
 
N

NBVC

Try these

=IF(Len(A1)=4,"Unapproved","")

=IF(OR(Left(A1)+0={4,5,6,9}),"","Unapproved"
 
J

Jacob Skaria

Shouldnt that be

=IF(ISNA(MATCH(LEFT(A1,1),{"4","5","6","9"},0)),"","UnApproved")

since the OP has asked for ""I want to say "begins with 4, 5, 6, or 9, give
me "","unapproved".""""


If this post helps click Yes
 
P

Pam M

Both of these items worked perfectly, and were the most concise of the
choices. thank you all for your help, Pam
 

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