IF, AND, or in one formula

SamBT

New Member
Joined
Feb 11, 2023
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Hi,

I need a formula to look at specific cells eg P4, R4, T4, AH4, check if they contain the words Pass and return List A, if not True, look at these cells if P contains fail or R contains fail, or T contains fail or AH contains failfaile, then return List C otherwise if excel cant find any of these conditions return list C.

can anyone help with the formula this one I have isnt working
=IF(AND(P4="PASS",R4="PASS",T4="PASS",X4="PASS",AC4="PASS",AE4="PASS",AH4="PASS",AN4="PASS","LIST A"),IF(OR(P4="FAIL",R4="FAIL",AH4="FAIL",AN4="FAIL"),"LIST C"))
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
what do you want happening in the yellow scenarios (reading conditions left to right):
WorkBook1.xlsx
ABCDE
3P4R4T4AH4
4PASSListA
5FAILList CList CList C
Sheet9
 
Upvote 0
Hi & welcome to MrExcel.
You have List C for two criteria, should one of them be something else?
 
Upvote 0
You're existing formula should be
Excel Formula:
=IF(AND(P4="PASS",R4="PASS",T4="PASS",X4="PASS",AC4="PASS",AE4="PASS",AH4="PASS",AN4="PASS"),"LIST A",IF(OR(P4="FAIL",R4="FAIL",AH4="FAIL",AN4="FAIL"),"LIST C","LIST ??"))
 
Upvote 0
PRTXACAEAHANOUTCOMES
PASSPASSPASSPASSPASSPASSPASSPASSLIST A
FAILList c
FAILLIST C
FAILLIST C
FAILLIST C


ALL COLUMNS MUST BE A PASS TO MAKE LIST A

IF ANY OF THESE COLUMNS CONTAIN A FAIL – LIST C

ELSE LIST B
 
Upvote 0
try this
WorkBook1.xlsx
ABCDEFGHI
9RTXACAEAHANOUTCOMES
10PASSPASSPASSPASSPASSPASSPASSPASSLISTA
11FAILLISTC
12LISTB
13FAILLISTC
14FAILLISTC
Sheet9
Cell Formulas
RangeFormula
I10:I14I10=IF(SUM(--(A10:H10="PASS"))=8, "LISTA", IF(SUM(--(A10:H10="FAIL"))>=1,"LISTC","LISTB"))
 
Upvote 0
try this
WorkBook1.xlsx
ABCDEFGHI
9RTXACAEAHANOUTCOMES
10PASSPASSPASSPASSPASSPASSPASSPASSLISTA
11FAILLISTC
12LISTB
13FAILLISTC
14FAILLISTC
Sheet9
Cell Formulas
RangeFormula
I10:I14I10=IF(SUM(--(A10:H10="PASS"))=8, "LISTA", IF(SUM(--(A10:H10="FAIL"))>=1,"LISTC","LISTB"))
that is looking at all columns for fail. If the middle four column are moot, then the formula needs to be adjusted
 
Upvote 0
Here it is with the middle four columns being moot for FAIL or PASS:
WorkBook1.xlsx
ABCDEFGHI
9RTXACAEAHANOUTCOMES
10PASSPASSPASSPASSPASSPASSPASSPASSLISTA
11FAILLISTC
12FAILLISTB
13PASSLISTB
14FAILLISTC
Sheet9
Cell Formulas
RangeFormula
I10:I14I10=IF(SUM(--(A10:H10="PASS"))=8, "LISTA", IF( SUM(--(A10:B10="FAIL"))+ SUM(--(G10:H10="FAIL")) >=1,"LISTC","LISTB"))
 
Upvote 0
I errored, I apologize, the columns are not connected.
Here is the solution using your cell references:
WorkBook1.xlsx
RTXACAEAHAMAN
9RTXACAEAHAM
10PASSPASSPASSPASSPASSPASSPASSLISTA
11FAILLISTC
12PASSLISTB
13FAILLISTB
14FAILLISTC
Sheet9
Cell Formulas
RangeFormula
AN10:AN13AN10=IF(AND(R10="PASS",T10="PASS",X10="PASS",AC10="PASS",AE10="PASS",AH10="PASS",AM10="PASS"),"LISTA", IF(OR(R10="FAIL",T10="FAIL",AH10="FAIL",AM10="FAIL"),"LISTC","LISTB"))
AN14AN14= IF(AND(R14="PASS",T14="PASS",X14="PASS",AC14="PASS",AE14="PASS",AH14="PASS",AM14="PASS"),"LISTA", IF(OR(R14="FAIL",T14="FAIL",AH14="FAIL",AM14="FAIL"),"LISTC","LISTB"))
 
Upvote 0

Forum statistics

Threads
1,215,020
Messages
6,122,709
Members
449,093
Latest member
Mnur

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