IF, AND & OR

Denny57

Board Regular
Joined
Nov 23, 2015
Messages
185
Office Version
  1. 365
Platform
  1. Windows
I cannot seem to get the IF, AND & OR syntax correct for what should be a simple check.

IF Cell B3 = A
AND Cell C3 = N
OR Cell D3 = N
Return Value of Cell B4, else leave blank

=IF(AND(B3="A",C3="N",D13="N"),B4,0)

Hopefully someone can provide the correct solution.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Does this work for you?
Excel Formula:
=IF(OR(AND(B3="A",C3="N"),D3="N"),B4,"")
 
Upvote 0
Sorry but I have just realised that this solution checks to see if any one of the statements is met.

I actually need a solution that allows for a variable value in Cell B3 whilst checking if cells C3 or D3 contain value N

If Cell B3 contains value A then if either Cell C3 or D3 has a value of N then return the value in cell B4, else leave blank
If Cell B3 contains value Z then if either Cell C3 or D3 has a value of N then return the value in cell B4, else leave blank

Aplologies for the confusion
 
Upvote 0
No problem. Does this work for you?
Excel Formula:
=IF(OR(B3="A",B3="Z"),IF(OR(C3="N",D3="N"),B4,""),"")
 
Upvote 0
Another option
Excel Formula:
=IF(AND(OR(B3={"A","Z"}),OR(C3="N",D3="N")),B4,"")
 
Upvote 0
=IF(OR(B3="A",B3="Z"),IF(OR(C3="N",D3="N"),B4,""),"")
I will try this, however, the records are in different sheets so I am really looking for two separate but similar solutions, one for each value for Cell B3
 
Upvote 0
In that case can you please explain EXACTLY what it is you are trying to do.
Providing an oversimplified example is never a good idea as you will never get something that works.
 
Upvote 0
Perhaps I can better explain

If Cell B3 = A (Logical Test 1 is True),then IF Cell C3 = N OR Cell D3 = N (Logical test 2 is True) then value = Cell B4 (True) else leave blank (False)
 
Upvote 0
Maybe
Excel Formula:
=IF(AND(B3="A",OR(C3="N",D3="N")),B4,"")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,951
Messages
6,122,446
Members
449,083
Latest member
Ava19

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