Nested AND OR IF function

Elfi35601

New Member
Joined
Jan 4, 2017
Messages
7
I'm trying to get a result based on the data shown in three cells. These three cells have formulas in and are referencing fields from different sheets - each cell will either pull through as "pass", "fail" or blank. I'm trying to get a formula that will show "PASS" if ALL 3 cells say "Pass", "FAIL" if ANY of the 3 cells say "Fail" and (I've managed to get this so far, it's this last bit I get stuck on) if ALL of the cells are blank I want the result to be a blank cell.

So far I have: =IF(AND(D11="Pass",E11="Pass",F11="Pass"),"PASS",IF(OR(D11="Fail",E11="Fail",F11="Fail"),"FAIL",IF(AND(LEN(D11)=0,LEN(E11)=0,LEN(F11)=0),"","")))

The AND and the OR work well, but it's the last function. Maybe I need to change the order? Also I'm not sure what to put for 'FALSE" for the last function - it depends on the previous AND or OR result. Finally, I had tried ISBLANK but of course that didn't work as there is a formula in each cell, so I used LEN instead.

Any help appreciated!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
What if one cell is Pass & the other two are blank?
 
Upvote 0
Thank you! Then I want "PASS" - essentially, I want the blank cells ignored - if only one person has 'scored' then that's the only cell to matter. So there might be up to three responses, but might be only one or two.
 
Upvote 0
...but as soon as any one person scores 'Fail" (no matter if there are 1, 2 or 3 people scoring) then the result MUST be 'FAIL" - "PASS" can only occur where there are only "Pass" (and blanks potentially)
 
Upvote 0
Ok, how about
Excel Formula:
=IF(COUNTIFS(D11:F11,"Fail"),"Fail",IF(COUNTIFS(D11:F11,"Pass"),"Pass",""))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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