IF AND OR Confusion!

robbarba

Board Regular
Joined
Apr 17, 2016
Messages
79
Office Version
  1. 365
Platform
  1. Windows
Hi Team,

In advance thanks for your help.

I have a group of four cells Y, Z, AA, and AB that can contain one of 3 values "Completed", "Waiting" or "Not App"
If all four cells = "Completed" or all four cells = "Not App" then in Cell AE say "Validated"
If any of the four cell contain any other data i.e. "Waiting" then in Cell AE say "Pending"

This is what I have so far:

=IF(AND(Y2="Not App",Z2="Not App",AA2="Not App",AB2="Not App")*OR (Y2="Completed",Z2="Completed",AA2="Completed",AB2="Completed"),"Validated","Pending")

my data set: Y2="Completed",Z2="Completed",AA2="Completed",AB2="Completed"

in cell AE2 I get the result "Pending"

Assistance is appreciated!
 
If I understand correct, I think this:

=IF(OR(AND(AA2="Completed",COUNTIF(Y2:AB2,"Not App")=3),COUNTIF(Y2:AB2,{"Completed","Not App"})=4),"Validated","Pending")

Or this depending on what your requirements are -I'm not for sure:

=IF(OR(AND(AA2="Completed",COUNTIF(Y2:AB2,{"Completed","NotApp"})=3),COUNTIF(Y2:AB2,{"Completed","NotApp"})=4),"Validated","Pending")
 
Last edited:
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
thanks for your assistance in advance,

Line 2 - Validated
Line 3 - Pending
Line 4 - Validated
Line 5 - Pending
Line 6 - Pending
All Blank - Pending
All Completed -
Completed
All Not App - Completed

Shouldn't the values in red be Validated?

M.
 
Upvote 0
Okay, so I could only get these two to work, again the one you use depends on your actual required criteria:

=IF(OR(AND(AA2="Completed",SUM(COUNTIF(Y2:AB2,{"Completed","Not App"}))=4),COUNTIF(Y2:AB2,{"Completed""Not App"})=4),"Validated","Pending")

=IF(OR(AND(AA2="Completed",COUNTIF(Y2:AB2,"Not App")=3),COUNTIF(Y2:AB2,{"Completed","Not App"})=4),"Validated","Pending")
 
Last edited:
Upvote 0
I've tested both and option #1 works as written giving the required results.

Thank you
 
Upvote 0
Guys,

After testing (entering 628 rows) I found that the following to be true

Completed Completed Completed Completed
Not App Not App Completed Not App
Not App Not App Completed Completed
Not App Not App Not App Not App


if you could explain the logic to make the necessary updates!
 
Upvote 0
Guys,

After testing (entering 628 rows) I found that the following to be true

Completed Completed Completed Completed
Not App Not App Completed Not App
Not App Not App Completed Completed
Not App Not App Not App Not App


if you could explain the logic to make the necessary updates!

What updates? Can you explain further? Do you want all of those listed above to be True and say "Validated"?

If not, then specifically show the cases that should be true.
 
Upvote 0
Maybe:

=IF(OR(COUNTIF(Y2:AB2,{"Completed","Not App"})=4,AND(Y2="Not App",Z2="Not App",AA2="Completed",OR(AB2={"Completed","Not App"}))),"Validated","Pending")
 
Last edited:
Upvote 0
testing the above formula now, let you know after a few hundred entries!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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