Nested IF AND OR Function

mrcortina1217

New Member
Joined
Oct 13, 2015
Messages
2
Hello -
I'm trying to evaluate the contents of two cells with 4 possible values.
I3 can contain either Active or Inactive
J3 can contain either YES or NO

IF I3="Active" AND J3="YES"
OR IF I3="Inactive" AND J3="NO"
THEN "Match"
ELSE "No Match"

I've tried several combinations and am not getting the results I expect - I'm looking for situations where either of these combinations do not exist.
For example, in the test row, I3=Active and J3=Yes ... so I would expect my formula to return "Match" however it returns "No Match"
=IF(AND(I3="Active",J3="YES",OR(AND(I3="Inactive",J3="NO"))),"Match","No Match")
Test rows containing other combinations of the variables also return "No Match".

[TABLE="width: 357"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]1st Variable[/TD]
[TD]2nd
Variable[/TD]
[TD]Results[/TD]
[TD]Expected Results[/TD]
[/TR]
[TR]
[TD]Active[/TD]
[TD]YES[/TD]
[TD]No Match[/TD]
[TD]Match[/TD]
[/TR]
[TR]
[TD]Inactive[/TD]
[TD]NO[/TD]
[TD]No Match[/TD]
[TD]Match[/TD]
[/TR]
[TR]
[TD]Active[/TD]
[TD]NO[/TD]
[TD]No Match[/TD]
[TD]No Match[/TD]
[/TR]
[TR]
[TD]Inactive[/TD]
[TD]YES[/TD]
[TD]No Match[/TD]
[TD]No Match[/TD]
[/TR]
</tbody>[/TABLE]

I'm stumped.

Many thanks in advance.
 
It looks like your OR is in the wrong place. Give this a try.

Code:
=IF([COLOR="#0000FF"]OR(AND(I3="Active",J3="YES"),AND(I3="Inactive",J3="NO"))[/COLOR],"Match","No Match")
 
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