combine 3 If AND statements

subz-zero

New Member
Joined
Aug 1, 2012
Messages
12
Hi

Can you help me in combining 3 statements below in to one line to i can put in one cell.

They work fine on each cell but need to combine.

Ive got one column with "high" "Medium" and "low" in there and one column with numbers in.

=IF(AND(D2 = "High,",I2 > 3),"FAILED High","PASS High"),
IF(AND(D2 = "Medium,",I2 > 10),"FAILED Medium","PASS Medium"),
IF(AND(D2 = "Low,",I2 > 20),"FAILED Low","PASS Low")

I want last column showing if the "High" passed or failed depending if the number criteria.

Hope this makes sense

Thanks in advance
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
What would the conditions be for the following:

PASS High
PASS Medium
PASS Low


?

Hi

If its High and more than 3 then its FAILED HIGH or else PASS HIGH
if its medium and more than 10 days then its FAILED MEDIUM or else PASS MEDIUM
if its low and more than 20 days then its FAILED LOW or else PASS LOW

Thanks again
 
Upvote 0
Try,

Code:
=IF(I2>MID("High03Medium10Low20",SEARCH(D2,"High03Medium10Low20")+LEN(D2),2)*1,"FAILED " & D2,"PASS " & D2)
 
Last edited:
Upvote 0
=IF(AND(D2="High,",I2>3),"FAILED High",IF(AND(D2="High,",I2<=3),"PASS High",IF(AND(D2="Medium,",I2>10),"FAILED Medium",IF(AND(D2="Medium,",I2<=10),"PASS Medium",IF(AND(D2="Low,",I2>20),"FAILED Low",IF(AND(D2="Low,",I2<=20),"PASS Low"))))))


I think this is what you want. Please let me know if this gives you the desired results.
 
Upvote 0
Hi

The code below is return FALSE in every cell


=IF(AND(D2="High,",I2>3),"FAILED High",IF(AND(D2="High,",I2<=3),"PASS High",IF(AND(D2="Medium,",I2>10),"FAILED Medium",IF(AND(D2="Medium,",I2<=10),"PASS Medium",IF(AND(D2="Low,",I2>20),"FAILED Low",IF(AND(D2="Low,",I2<=20),"PASS Low"))))))


I think this is what you want. Please let me know if this gives you the desired results.
 
Upvote 0
It worked on my sheet when I put a number in I2, and High, Medium, or Low, in D2.

I did notice that your formula is looking for "High," in D2, are you sure it should be looking for the comma?

Could you possibly copy what you currently have in I2 and D2 so I can compare?
 
Upvote 0
Hi

It shouldnt contain commas, sorry about that, ive taken them out and it seems to work

Many thanks for your help quys and quick responses.
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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