Excel Formula - If ...or ...and ...or ....and

Joined
Jan 12, 2005
Messages
3
I want to use multiple values within conditions to check for validity. Example: If a=3 and b=4 or if a=5 and b=8 or if a=15 and b= 27 then "pass' else "fail". How do I compose a formula for this?
 
With your two values a and b in cells D7 and E7, respectively:
=IF(OR(AND(D7=3,E7=4),AND(D7=5,E7=8),AND(D7=15,E7=27)),"pass","fail")

This will currently give "fail" if both are blank. Post back if that's not what you want. Hope that helps!
 
Upvote 0
Welcome.

=if(or(and(a=3,b=4),and(a=5,b=8),and(a=15,b=27)),"Pass","Fail")

Replace a and b with the cell references.

e.g.:
=IF(OR(AND(A1=3,B1=4),AND(A1=5,B1=8),AND(A1=15,B1=27)),"Pass","Fail")
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top