PDA

View Full Version : Nested If Formula With Multiple Conditions



lprc
04-21-2013, 09:40 PM
Hello!
Please, can someone tell me how can I make formula for:
If D2 ; E2 ; F2 >= 4 and G2 >=5 , than H2 = 18, but IF D2 ; E2 ; F2 >= 4 and G2 >=7 , that H2 = 27. If any of these numbers are less than the condition, than H2 = 0 .

That would be unspeakably helpful for me ! :)

LalitPandey87
04-22-2013, 07:40 AM
Try this formula:

=IF(AND(D2>=4,E2>=4,F2>=4),IF(AND(G2>=5,G2<7),18,IF(G2>=7,27,0)),0)

:cheers:

Excel Fox
04-22-2013, 07:59 AM
Try this


=IF(AND(D2>=4,E2>=4,F2>=4,G2>=7),27,IF(AND(D2>=4,E2>=4,F2>=4,G2>=5),18,0))

LalitPandey87
04-22-2013, 08:10 AM
Hi Excel Fox,

I have tried this formula and it's giving only one result in multiple test which is 18. I think because of G2>=5 and G2>=7 conditons. Correct me if i am wrong.

Excel Fox
04-22-2013, 08:39 AM
Lalit, corrected it. It was because I used the smaller valued conditional first, rather than the larger one. Swapped it :)

LalitPandey87
04-22-2013, 09:03 AM
Another try:

=IF(AND(D2>=4,E2>=4,F2>=4),IF(G2>=7,27,IF(G2>=5,18,0)),0)

Rick Rothstein
04-22-2013, 10:22 AM
Another (slightly shorter) formula that appears to work...

=IF(OR(COUNTIF(D2:F2,"<4"),G2<5),0,18+9*(G2>=7))

lprc
04-22-2013, 01:14 PM
None of these formulas are working for me . :( , but thanks anyways. :)

LalitPandey87
04-22-2013, 01:26 PM
Formula given by me and by experts are based on what you have asked.
If it is not working then why don't share your file for better clearity.

lprc
04-22-2013, 05:04 PM
Here is the file.

Rick Rothstein
04-22-2013, 07:27 PM
Here is the file.

None of these formulas are working for me . :( , but thanks anyways. :)
I posted this formula earlier...

=IF(OR(COUNTIF(D2:F2,"<4"),G2<5),0,18+9*(G2>=7))

Please describe in what way it is not working for you.

Also, I notice you have the letter 'n' appearing at some locations within Columns D:F... how did you want the formula to handle them (being they are not numbers)... Ignore them? Treat them as if they were 0? Something else?