Aral Code

Functions Lesson 6 of 13

Excel IF, Nested IF, IFS, AND and OR

Make decisions in Excel with IF, nested IF and IFS for DepEd grade descriptors, combine conditions with AND and OR, and handle errors with IFERROR.

IF lets a formula choose between two results based on a condition, like PASSED or FAILED. It's one of the most-used functions in Excel.

IF

=IF(condition, value_if_true, value_if_false)
ABC
1StudentGradeRemark
2Ana88=IF(B2>=75, "PASSED", "FAILED")
3Ben72=IF(B3>=75, "PASSED", "FAILED")

Results: Ana → PASSED, Ben → FAILED. Text results go in double quotes; numbers and cell references don't.

Comparison operators

OperatorMeaning
=Equal (in a condition)
<>Not equal
>, <Greater / less than
>=, <=Greater / less than or equal

IF can also compute: =IF(C2>=1000, C2*0.95, C2) gives a 5% discount on orders of ₱1,000 or more.

Nested IF: more than two outcomes

Put an IF inside another IF. Here are the DepEd grade descriptors:

=IF(B2>=90, "Outstanding",
 IF(B2>=85, "Very Satisfactory",
 IF(B2>=80, "Satisfactory",
 IF(B2>=75, "Fairly Satisfactory", "Did Not Meet Expectations"))))
ABC
1StudentGradeDescriptor
2Ana92Outstanding
3Ben86Very Satisfactory
4Carla81Satisfactory
5Dan77Fairly Satisfactory
6Ela70Did Not Meet Expectations

Excel checks from the first condition and stops at the first true one, so start with the highest range. (You can press Alt + Enter inside the formula bar to break a long formula into lines.)

IFS: cleaner multiple conditions

Excel 2019 / Microsoft 365 and Google Sheets have IFS, which avoids all the nested parentheses:

=IFS(B2>=90, "Outstanding", B2>=85, "Very Satisfactory", B2>=80, "Satisfactory",
     B2>=75, "Fairly Satisfactory", TRUE, "Did Not Meet Expectations")

The final TRUE acts as "everything else".

AND and OR

ABCD
1StudentAverageLowestWith honors?
2Ana92.588=IF(AND(B2>=90, C2>=85), "Yes", "No")
3Ben91.082=IF(AND(B3>=90, C3>=85), "Yes", "No")

Ana → Yes; Ben → No, because one grade is below 85. AND is true only if all conditions are true; OR is true if at least one is:

=IF(OR(age>=60, isPWD="Yes"), "20% discount", "Regular price")

(Use real cell references, like =IF(OR(B2>=60, C2="Yes"), ...).)

Empty cells

=IF(B2="", "", IF(B2>=75, "PASSED", "FAILED"))

The outer IF leaves the remark empty until a grade is typed, so a new class record doesn't show "FAILED" for every student.

IFERROR

ABC
1TotalCountAverage
24505=IFERROR(A2/B2, "-")
300=IFERROR(A3/B3, "-")

A3/B3 would show #DIV/0!. IFERROR shows "-" instead. Use it for expected errors, not to hide real mistakes.

Quick Quiz

Check what you learned. Walang grade ito, practice lang. 🙂

1. What does =IF(B2>=75, "PASSED", "FAILED") return when B2 is 75?
2. When is AND(A1>5, B1>5) true?
3. Why start a nested IF with the highest grade range?
4. What does IFERROR do?

By Sir Reyel · Last updated 2026-12-04