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)
| A | B | C | |
|---|---|---|---|
| 1 | Student | Grade | Remark |
| 2 | Ana | 88 | =IF(B2>=75, "PASSED", "FAILED") |
| 3 | Ben | 72 | =IF(B3>=75, "PASSED", "FAILED") |
Results: Ana → PASSED, Ben → FAILED. Text results go in double quotes; numbers and cell references don't.
Comparison operators
| Operator | Meaning |
|---|---|
= | 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"))))
| A | B | C | |
|---|---|---|---|
| 1 | Student | Grade | Descriptor |
| 2 | Ana | 92 | Outstanding |
| 3 | Ben | 86 | Very Satisfactory |
| 4 | Carla | 81 | Satisfactory |
| 5 | Dan | 77 | Fairly Satisfactory |
| 6 | Ela | 70 | Did 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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Student | Average | Lowest | With honors? |
| 2 | Ana | 92.5 | 88 | =IF(AND(B2>=90, C2>=85), "Yes", "No") |
| 3 | Ben | 91.0 | 82 | =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
| A | B | C | |
|---|---|---|---|
| 1 | Total | Count | Average |
| 2 | 450 | 5 | =IFERROR(A2/B2, "-") |
| 3 | 0 | 0 | =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. 🙂
By Sir Reyel · Last updated 2026-12-04