International College of Digital Innovation, CMU
June 20, 2026
In Excel, the IF function can be used in various ways depending on the objective. The logic is based on conditional operators, which can be grouped into three main forms as shown below:
| Symbol | Meaning | Example (Formula) | Result |
|---|---|---|---|
= |
Equal to | =A1=10 |
TRUE / FALSE |
<> |
Not equal to | =A1<>10 |
TRUE / FALSE |
> |
Greater than | =A1>10 |
TRUE / FALSE |
< |
Less than | =A1<10 |
TRUE / FALSE |
>= |
Greater than or equal to | =A1>=10 |
TRUE / FALSE |
<= |
Less than or equal to | =A1<=10 |
TRUE / FALSE |
Copy and paste the table below into Excel starting at cell A1.
| Name | Exam Score | Age | Status |
|---|---|---|---|
| John | 85 | 20 | – |
| Emily | 45 | 22 | – |
| Sophia | 55 | 18 | – |
| Michael | 90 | 21 | – |
| Daniel | 40 | 19 | – |
| Olivia | 60 | 24 | – |
| Ethan | 78 | 23 | – |
| Lucas | 30 | 17 | – |
| William | 95 | 25 | – |
| Isabella | 50 | 19 | – |
Check whether the exam score is “Pass” or “Fail” (Passing score is 50).
Used in combination with other functions (such as AND, OR, or calculations) to create more complex logic.
Syntax:
or
Examples:
or
Result in the “Status” column:
| Status |
|---|
| Does not meet criteria |
| Pass and over 20 |
| Does not meet criteria |
| Pass and over 20 |
| Does not meet criteria |
| Pass and over 20 |
| Pass and over 20 |
| Does not meet criteria |
| Pass and over 20 |
| Does not meet criteria |
Check if the exam score is passing OR age is over 20
Formula:
Result in the “Status” column:
| Status |
|---|
| Pass or over 20 |
| Pass or over 20 |
| Pass or over 20 |
| Pass or over 20 |
| Does not meet criteria |
| Pass or over 20 |
| Pass or over 20 |
| Does not meet criteria |
| Pass or over 20 |
| Pass or over 20 |
IFS: Used to check multiple conditions, similar to nested IF, but in a simpler and more readable form.
Example: Using the IFS Function
Assigning Score Levels
Criteria:
Greater than 80: "Excellent"
Between 50–80: "Good"
Less than 50: "Needs Improvement"
Formula:
Result in the “Status” column:
| Status |
|---|
| Excellent |
| Needs Improvement |
| Good |
| Excellent |
| Needs Improvement |
| Good |
| Good |
| Needs Improvement |
| Excellent |
| Good |
SWITCH: Used when you have multiple specific values to compare against (ideal for constant value comparisons).
Example: Using the SWITCH Function
In this example, we assign letter grades based on exam scores:
Score greater than 80: “A”
Score between 50 and 80: “B”
Score less than 50: “F”
How to Use SWITCH
Since SWITCH cannot directly evaluate comparison operators (such as greater than or less than),
you need to convert conditions into constant values using another function like TRUE to handle range logic.
Formula:
Explanation of the Formula
SWITCH(TRUE, ...): Allows SWITCH to behave like IF, checking conditions one by one
B2>80: If the score is greater than 80, return "A"
B2>=50: If the score is between 50 and 80, return "B"
TRUE: Catch-all fallback condition — if none of the above are met, return "F"
Result from the formula in the “Status” column
| Name | Exam Score | Status |
|---|---|---|
| John | 85 | A |
| Emily | 45 | F |
| Sophia | 55 | B |
| Michael | 90 | A |
| Daniel | 40 | F |
| Olivia | 60 | B |
| Ethan | 78 | B |
| Lucas | 30 | F |
| William | 95 | A |
| Isabella | 50 | B |
Advantages of SWITCH
Easier to read than Nested IF or IFS when dealing with multiple conditions.
More concise structure for constant values or simple logical expressions.
Copy the table and paste it into cell A1 in Excel.
| Employee | Position | Salary | Evaluation Score |
|---|---|---|---|
| A1 | Supervisor | 70000 | 100 |
| A2 | Staff | 80000 | 65 |
| A3 | Manager | 70000 | 95 |
| A4 | Staff | 85000 | 55 |
| A5 | Manager | 65000 | 85 |
| A6 | Manager | 50000 | 50 |
| A7 | Supervisor | 40000 | 95 |
| A8 | Staff | 35000 | 75 |
| A9 | Supervisor | 45000 | 50 |
| A10 | Supervisor | 35000 | 100 |
| A11 | Supervisor | 80000 | 65 |
| A12 | Supervisor | 95000 | 55 |
| A13 | Staff | 45000 | 65 |
| A14 | Staff | 90000 | 75 |
| A15 | Supervisor | 30000 | 95 |
| A16 | Manager | 45000 | 95 |
| A17 | Staff | 95000 | 85 |
| A18 | Supervisor | 65000 | 60 |
| A19 | Staff | 40000 | 65 |
| A20 | Manager | 70000 | 85 |
Condition:
If score ≥ 75 → gets a bonus
If score < 75 → no bonus
Condition:
Score ≥ 90 → 15% bonus
Score ≥ 80 → 10% bonus
Score ≥ 70 → 5% bonus
Below 70 → no bonus
Condition:
If salary < 50,000 and score ≥ 80 → 10% bonus
If salary ≥ 50,000 and score ≥ 90 → 5% bonus
Otherwise → no bonus
Condition:
“Staff” → Level 1
“Supervisor” → Level 2
“Manager” → Level 3
1)
=IF(D2>=75, "Bonus", "No Bonus")
2)
=IFS(D2>=90, "15%", D2>=80, "10%", D2>=70, "5%", D2<70, "0%")
3)
=IF(B2<50000, IF(D2>=80, "10%", "0%"), IF(D2>=90, "5%", "0%"))
4)
=SWITCH(B2, "Staff", 1, "Supervisor", 2, "Manager", 3, "Unknown")