# Troubleshooting nested IF function

I am having trouble with the IF function in the example below.

Conditions:

• There are 3 exams and one total score.
• The student has to score at least 5 points in each exams to pass.
• If he has in one of the exams a score of 4 or less points he fails.
• However, the total score has to be >=16 to pass, otherwise he also fails.

Example 1:

Test 1 = 4, Test 2 = 10, Test 3 = 10, Total = 24; he has more than 16 but fails because he got a 4 in one of the exams.

Example 2:

Test 1 = 5, Test 2 = 5, Test 3 = 5, Total =15; fails again because the total score is under 16.

Problem:

I used this function:

``````=IF(E4>=5;IF(F4>=5;IF(G4>=5;IF(H4>=16;"Pass";"Fail"))))
``````

It works fine except in the scenario where the student gets a 4 or less in one of the exams. When this happens, I get `FALSE` but I want it to be `Fail`.

Screenshot:

• You've provided true and false values for the inner-most nested IF, but none of the others. You can do this with AND: =IF(AND(E4>=5,F4>=5,G4>=5,H4>=16);"Pass";"Fail") – fixer1234 Sep 26 '16 at 23:32
• Thanks a lot for the fast reply and of course it worked :) – An Acount Sep 26 '16 at 23:38

``````=IF(AND(E4>=5,F4>=5,G4>=5,H4>=16);"Pass";"Fail")