how to use if,and,or functions together in excel

G

Guest

I want to create a formula as follows
IF cell x = 1, AND cell y=3, 4, 5, OR 6, then give me answer of OK,
otherwise NOT OK
 
J

Johannes

cell x = A1
cell y = A2

= IF( AND(A1 = 1, OR( A2 = 3, A2 = 4, A2 = 5, A2 = 6) ), "OK", "NOT OK" )

depending on configuration use semi-colon instead of colon.

JP
 
A

Alex Delamain

If your terms arenice and simple (e.g. value is between 3 and 6) then:
=IF(AND(A1=1,B1>=3,B1<=6),"OK","Not Ok")

if there are gaps (e.g. 3,4,6 but not 5) then

=IF(AND(A1=1,OR(B1=3,B1=4,B1=5,B1=6)),"OK","Not Ok")
 

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