Introduction
The IF function is one of the most useful Excel functions for making decisions based on conditions. It can return different results depending on whether a condition is true or false. In this chapter, you will practice IF, Nested IF, and IFS with student results, employee performance, sales targets, discounts, grades, and other practical examples. The questions start with simple conditions and gradually move toward multiple-condition problems. Excel-IF Nested IF and IFS practice questions with solutions to help you understand the concepts.
Q1. Check Whether a Student Passed or Failed
Problem Statement
A student passes if their marks are 40 or more. Use IF to display "Pass" or "Fail".
Sample Data
| Student | Marks |
|---|---|
| Rahul | 75 |
| Priya | 38 |
| Amit | 62 |
| Neha | 29 |
| Karan | 45 |
Excel Formula
In C2:
=IF(B2>=40,"Pass","Fail")
Copy the formula down.
Output
| Student | Marks | Result |
|---|---|---|
| Rahul | 75 | Pass |
| Priya | 38 | Fail |
| Amit | 62 | Pass |
| Neha | 29 | Fail |
| Karan | 45 | Pass |
Explanation
The formula checks:
Marks >= 40
If the condition is true, Excel returns:
Pass
Otherwise:
Fail
Concept Covered
IF- Comparison operator
- True/False result
Q2. Check Employee Bonus Eligibility
Problem Statement
An employee receives a bonus if their sales are ₹50,000 or more.
Sample Data
| Employee | Sales |
|---|---|
| Rahul | 55000 |
| Priya | 42000 |
| Amit | 65000 |
| Neha | 48000 |
| Karan | 70000 |
Excel Formula
=IF(B2>=50000,"Bonus","No Bonus")
Output
| Employee | Sales | Bonus Status |
|---|---|---|
| Rahul | 55000 | Bonus |
| Priya | 42000 | No Bonus |
| Amit | 65000 | Bonus |
| Neha | 48000 | No Bonus |
| Karan | 70000 | Bonus |
Explanation
Excel checks whether the sales value is at least ₹50,000.
For Rahul:
55000 >= 50000 → TRUE
Therefore:
Bonus
Concept Covered
IF- Numeric condition
- Business decision
Q3. Categorize Students Using Nested IF
Problem Statement
Classify students according to their marks:
- 80 or above →
Excellent - 60 or above →
Good - 40 or above →
Pass - Below 40 →
Fail
Sample Data
| Student | Marks |
|---|---|
| Rahul | 92 |
| Priya | 76 |
| Amit | 58 |
| Neha | 35 |
| Karan | 64 |
Excel Formula
=IF(B2>=80,"Excellent",IF(B2>=60,"Good",IF(B2>=40,"Pass","Fail")))
Output
| Student | Marks | Result |
|---|---|---|
| Rahul | 92 | Excellent |
| Priya | 76 | Good |
| Amit | 58 | Pass |
| Neha | 35 | Fail |
| Karan | 64 | Good |
Explanation
This is a Nested IF because one IF is placed inside another IF.
Excel checks the conditions in order:
Marks >= 80
If false:
Marks >= 60
If false:
Marks >= 40
If all are false:
Fail
Concept Covered
- Nested
IF - Multiple conditions
- Student grading
Q4. Assign Grades Using Nested IF
Problem Statement
Assign grades according to percentage:
| Percentage | Grade |
|---|---|
| 90 or above | A+ |
| 80–89 | A |
| 70–79 | B |
| 60–69 | C |
| Below 60 | D |
Sample Data
| Student | Percentage |
|---|---|
| Rahul | 95 |
| Priya | 84 |
| Amit | 73 |
| Neha | 65 |
| Karan | 52 |
Excel Formula
=IF(B2>=90,"A+",IF(B2>=80,"A",IF(B2>=70,"B",IF(B2>=60,"C","D"))))
Output
| Student | Percentage | Grade |
|---|---|---|
| Rahul | 95 | A+ |
| Priya | 84 | A |
| Amit | 73 | B |
| Neha | 65 | C |
| Karan | 52 | D |
Explanation
Excel evaluates the conditions from left to right.
For Amit:
73 >= 90 → FALSE
73 >= 80 → FALSE
73 >= 70 → TRUE
Therefore:
B
Concept Covered
- Nested
IF - Grade classification
- Multiple ranges
Q5. Categorize Sales Performance Using IFS
Problem Statement
Classify employees based on their monthly sales:
- ₹70,000 or more →
Excellent - ₹50,000 or more →
Very Good - ₹30,000 or more →
Good - Below ₹30,000 →
Needs Improvement
Sample Data
| Employee | Sales |
|---|---|
| Rahul | 85000 |
| Priya | 62000 |
| Amit | 45000 |
| Neha | 25000 |
| Karan | 73000 |
Excel Formula
=IFS(B2>=70000,"Excellent",B2>=50000,"Very Good",B2>=30000,"Good",B2<30000,"Needs Improvement")
Output
| Employee | Sales | Performance |
|---|---|---|
| Rahul | 85000 | Excellent |
| Priya | 62000 | Very Good |
| Amit | 45000 | Good |
| Neha | 25000 | Needs Improvement |
| Karan | 73000 | Excellent |
Explanation
IFS allows you to test multiple conditions without repeatedly writing IF.
For Amit:
45000 >= 70000 → FALSE
45000 >= 50000 → FALSE
45000 >= 30000 → TRUE
Result:
Good
Concept Covered
IFS- Multiple conditions
- Sales classification
Q6. Calculate a Discount Based on Purchase Amount
Problem Statement
Give customers a discount according to their purchase amount:
- ₹50,000 or more → 20%
- ₹30,000 or more → 15%
- ₹10,000 or more → 10%
- Below ₹10,000 → 5%
Sample Data
| Customer | Purchase Amount |
|---|---|
| Rahul | 55000 |
| Priya | 35000 |
| Amit | 18000 |
| Neha | 7000 |
| Karan | 62000 |
Excel Formula
=IFS(B2>=50000,20%,B2>=30000,15%,B2>=10000,10%,B2<10000,5%)
Output
| Customer | Purchase Amount | Discount |
|---|---|---|
| Rahul | 55000 | 20% |
| Priya | 35000 | 15% |
| Amit | 18000 | 10% |
| Neha | 7000 | 5% |
| Karan | 62000 | 20% |
Explanation
For Priya:
35000 >= 50000 → FALSE
35000 >= 30000 → TRUE
Therefore, the discount is:
15%
Concept Covered
IFS- Percentage values
- Conditional pricing
Q7. Calculate Employee Commission Using Nested IF
Problem Statement
Calculate commission based on sales:
- ₹100,000 or more → 10%
- ₹75,000 or more → 7%
- ₹50,000 or more → 5%
- Below ₹50,000 → 2%
Then calculate the actual commission amount.
Sample Data
| Employee | Sales |
|---|---|
| Rahul | 120000 |
| Priya | 85000 |
| Amit | 60000 |
| Neha | 42000 |
| Karan | 100000 |
Commission Rate Formula
=IF(B2>=100000,10%,IF(B2>=75000,7%,IF(B2>=50000,5%,2%)))
Commission Amount Formula
If the commission rate is in C2:
=B2*C2
Output
| Employee | Sales | Rate | Commission |
|---|---|---|---|
| Rahul | 120000 | 10% | 12000 |
| Priya | 85000 | 7% | 5950 |
| Amit | 60000 | 5% | 3000 |
| Neha | 42000 | 2% | 840 |
| Karan | 100000 | 10% | 10000 |
Explanation
For Priya:
85000 >= 100000 → FALSE
85000 >= 75000 → TRUE
So her commission rate is:
7%
Commission:
85000 × 7% = 5950
Concept Covered
- Nested
IF - Percentage calculation
- Commission calculation
- Business data analysis
Q8. Check Stock Status Using IF
Problem Statement
Display:
"Out of Stock"if stock is 0"Low Stock"if stock is 1–10"In Stock"if stock is greater than 10
Sample Data
| Product | Stock |
|---|---|
| Laptop | 15 |
| Mouse | 0 |
| Keyboard | 8 |
| Monitor | 25 |
| Webcam | 5 |
Excel Formula
=IF(B2=0,"Out of Stock",IF(B2<=10,"Low Stock","In Stock"))
Output
| Product | Stock | Status |
|---|---|---|
| Laptop | 15 | In Stock |
| Mouse | 0 | Out of Stock |
| Keyboard | 8 | Low Stock |
| Monitor | 25 | In Stock |
| Webcam | 5 | Low Stock |
Explanation
The formula first checks whether stock is zero.
If not, it checks whether stock is 10 or less.
For Keyboard:
8 = 0 → FALSE
8 <= 10 → TRUE
Result:
Low Stock
Concept Covered
- Nested
IF - Inventory analysis
- Multiple conditions
Q9. Check Eligibility Using IF and AND
Problem Statement
A student is eligible for a scholarship if:
- Marks are at least 80
- Attendance is at least 75%
Sample Data
| Student | Marks | Attendance |
|---|---|---|
| Rahul | 90 | 85% |
| Priya | 82 | 70% |
| Amit | 75 | 90% |
| Neha | 88 | 80% |
| Karan | 79 | 85% |
Excel Formula
=IF(AND(B2>=80,C2>=75%),"Eligible","Not Eligible")
Output
| Student | Marks | Attendance | Result |
|---|---|---|---|
| Rahul | 90 | 85% | Eligible |
| Priya | 82 | 70% | Not Eligible |
| Amit | 75 | 90% | Not Eligible |
| Neha | 88 | 80% | Eligible |
| Karan | 79 | 85% | Not Eligible |
Explanation
AND requires both conditions to be true.
For Rahul:
Marks >= 80 → TRUE
Attendance >= 75% → TRUE
Therefore:
Eligible
For Priya:
Marks >= 80 → TRUE
Attendance >= 75% → FALSE
Therefore:
Not Eligible
Concept Covered
IFAND- Multiple conditions
- Eligibility checking
Q10. Compare Nested IF and IFS for Employee Performance
Problem Statement
Create an employee performance classification using four levels:
- 90 or above →
Outstanding - 75 or above →
Excellent - 60 or above →
Good - Below 60 →
Needs Improvement
Solve the problem using both Nested IF and IFS.
Sample Data
| Employee | Performance Score |
|---|---|
| Rahul | 95 |
| Priya | 82 |
| Amit | 68 |
| Neha | 55 |
| Karan | 91 |
Solution 1: Nested IF
=IF(B2>=90,"Outstanding",IF(B2>=75,"Excellent",IF(B2>=60,"Good","Needs Improvement")))
Solution 2: IFS
=IFS(B2>=90,"Outstanding",B2>=75,"Excellent",B2>=60,"Good",B2<60,"Needs Improvement")
Output
| Employee | Score | Result |
|---|---|---|
| Rahul | 95 | Outstanding |
| Priya | 82 | Excellent |
| Amit | 68 | Good |
| Neha | 55 | Needs Improvement |
| Karan | 91 | Outstanding |
Explanation
Both formulas produce the same result.
The difference is mainly in how the conditions are written.
Nested IF:
IF
└── IF
└── IF
IFS:
Condition 1 → Result 1
Condition 2 → Result 2
Condition 3 → Result 3
Condition 4 → Result 4
For several conditions, IFS can make the formula easier to read.
Concepts Covered
- Nested
IF IFS- Multiple conditions
- Performance classification
- Comparing Excel functions
Key Takeaways
IFis used to make decisions based on a condition.Nested IFallows you to test multiple conditions.IFSprovides a convenient way to handle multiple conditions.ANDcan be combined withIFwhen all conditions must be true.- The order of conditions is important in Nested
IFandIFS. - Higher thresholds should generally be checked before lower thresholds when creating categories.
IFcan be used for grades, bonuses, discounts, stock status, eligibility, and many other practical tasks.IFScan make formulas with many conditions easier to read.- Nested
IFremains useful for compatibility and situations whereIFSis not available. - Practice with real datasets helps you understand when to use each conditional function.
FAQs
1. What is the IF function in Excel?
IF checks whether a condition is true or false and returns one result when true and another result when false.
Example:
=IF(B2>=40,"Pass","Fail")
2. What is a Nested IF formula?
A Nested IF is an IF formula containing another IF function. It is used when more than two possible results are required.
Example:
=IF(B2>=80,"A",IF(B2>=60,"B",IF(B2>=40,"C","F")))
3. What is the IFS function in Excel?
IFS checks multiple conditions and returns the result associated with the first condition that evaluates to TRUE.
Example:
=IFS(B2>=80,"A",B2>=60,"B",B2>=40,"C",B2<40,"F")
4. What is the difference between IF and IFS in Excel?
IF is generally used for a condition with two possible outcomes, while IFS is designed to handle multiple conditions and corresponding results.
5. Is IFS better than Nested IF?
They solve similar types of problems, but IFS can make formulas with many conditions easier to read. Nested IF can still be useful when working with older Excel versions or when a specific formula structure is needed.
6. Can IF be combined with AND?
Yes. IF and AND can be combined when multiple conditions must be true.
=IF(AND(B2>=80,C2>=75%),"Eligible","Not Eligible")
7. Does the order of conditions matter in IFS?
Yes. IFS returns the result for the first TRUE condition. Therefore, conditions should be arranged carefully.
Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.
