IF(AND(OR function

poikl

Active Member
Joined
Jun 8, 2002
Messages
466
Platform
  1. Windows
Could you please help me with this function so that it should work?
I would like to check in Cel-D2 if it equals either "AA", "AB" and Cel-E2 does not equal "Pass" or it (Cel-E2) equals N/A# then Cel-F2 should show "Problem" otherwise it (Cel-F2) should show "OK" ?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try this:

=if(and(or(D2="AA",D2="AB"),or(E2<>"Pass",isna(E2))),"Problem","OK")
 
Upvote 0
=if(or(and(or(d2="AA",d2=" "AB") ,E2<> "Pass"),isna(e2)),"Problem", "OK")


I think!
 
Upvote 0
I don't know what I am doing wrong buttried both and they don't work1
If Cel-E2 equals N/A# then Cel-F2 also shows N/A# instead of "Problem?

Also I forgot, it needs to check in Cel-E2 for 3 things (not just the 2 as mentioned before), 1) not to equal "Pass' or 2) Not to equal "shipped' or 3) not to equal N/A#.
 
Upvote 0
poikl said:
I don't know what I am doing wrong buttried both and they don't work1
If Cel-E2 equals N/A# then Cel-F2 also shows N/A# instead of "Problem?

Also I forgot, it needs to check in Cel-E2 for 3 things (not just the 2 as mentioned before), 1) not to equal "Pass' or 2) Not to equal "shipped' or 3) not to equal N/A#.

Are you saying that:

If E2 is AA or AB and E2 is not equal Pass or Shipped or E2 houses #N/A then F2 = Problem, otherwise F2 = OK.
 
Upvote 0
Aladyn I'm so glad to hear from you.
What I need that Cel-F2 is to check if Cel-E2 equals either "AA" or "AB" and Cel-F2 does not equal any of the following, 1) Cel-F2 does NOT equal "Pass', 2) Cel-F2 does NOT equal "Shipped',or 3) Cel-F2 equals N/A#, then,then Cel-F2 should show "Problem" otherwise, it (Cel-F2) should show "OK" ?
 
Upvote 0
poikl said:
...

What I need that Cel-F2 is to check if Cel-E2 equals either "AA" or "AB" and Cel-F2 does not equal any of the following, 1) Cel-F2 does NOT equal "Pass', 2) Cel-F2 does NOT equal "Shipped',or 3) Cel-F2 equals N/A#, then,then Cel-F2 should show "Problem" otherwise, it (Cel-F2) should show "OK" ?

You mean E2, not F2. This does not seem to be different from the recap I attempted, apart from the D2/E2/F2 mix up.

But what must happen when D2 is empty and E2 houses, say, Sent or when D2 and E2 are both empty?
 
Upvote 0
Aladyn you're always sharp.
Yes, I meant Cel-D2 and Cel-E2 repectavly.
If both, Cel-D2 and Cel-E2 are empty that's ok so I guess '' (blank) would be the correct response.
I did not consider when Cel-E2 has "Shipped" and Cel-D2 is empty, that too would be a problem but it should show differently say, "Not Designated"
Thank you for picking it up.
 
Upvote 0
poikl said:
Aladyn you're always sharp.
Yes, I meant Cel-D2 and Cel-E2 repectavly.
If both, Cel-D2 and Cel-E2 are empty that's ok so I guess '' (blank) would be the correct response.
I did not consider when Cel-E2 has "Shipped" and Cel-D2 is empty, that too would be a problem but it should show differently say, "Not Designated"
Thank you for picking it up.
Book4
DEFGHIJK
1Sortkey
2#N/AProblemShipped@ShippedNotDesignated
3AAPassAA@PassOK
4AAShippedAA@ShippedOK
5ABPassAB@PassOK
6ABShippedAB@ShippedOK
7
8
Sheet1


How about setting up a table of diagnostics?

J2, copied down:

=H2&"@"&I2

The area H2:K6 is sorted in ascending order on column J.

J2:K6 is named Table (via the Name Box on the Formula Bar).

The formula for diagnosis of D2:E2 in F2 is:

=IF(ISNA(E2),"Problem",IF(LOOKUP(D2&"@"&E2,INDEX(Table,0,1))=D2&"@"&E2,LOOKUP(D2&"@"&E2,Table),"Problem"))
 
Upvote 0
too fancy,
can't I just make a simple IF(AND(OR...
that is what I was hoping for.
Please?
 
Upvote 0

Forum statistics

Threads
1,221,668
Messages
6,161,158
Members
451,687
Latest member
KENNETH ROGERS

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