Stumped by IF

R

Riskybizniz

Hi, a (likely) easy problem but has me stumped.
A user can enter an article code in A1. I want to check if this value is
between 30000 and 40000 OR between 550000 and 569999. If the value falls
outside these 2 ranges A2 displays Error. I have been trying IF in
combination with OR, AND etc...

help?

kindest regards,
Chris
 
G

garfield-n-odie

Try:
=IF(OR(AND(A1>=30000,A1<=50000),AND(A1>=550000,A1<=569999)),"true","false")
 
F

Frank Kabel

Hi
one way:
=IF(OR(AND(A1>=30000,A1<=40000),AND(A1>=550000,A1<=569999)),"No
error","Error")
 
R

Riskybizniz

Great!!! dare I ask one more thing? If nothing is entered there should be no
message.

thanks!!
Chris
 
G

garfield-n-odie

=IF(ISBLANK(A1),"",IF(OR(AND(A1>=30000,A1<=50000),AND(A1>=550000,A1<=569999)),"true","false"))
 

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