To use IF ELSE IF in Excel, nest one IF function inside another IF’s value_if_false argument. Excel evaluates each condition left to right and returns the result of the first true test. For example: =IF(A2>=90,”A”,IF(A2>=75,”B”,IF(A2>=60,”C”,”F”))) checks three conditions in sequence. There is no separate ELSE IF keyword in Excel.
- Key Takeaway 1: Excel has no dedicated ELSE IF keyword. You build an else-if chain by nesting IF inside IF’s value_if_false slot.
- Key Takeaway 2: Excel 2019 and Microsoft 365 support up to 64 nested IFs, but anything beyond 4-5 levels is hard to debug. Switch to IFS instead.
- Key Takeaway 3: Alt+Enter inside the formula bar plus consistent indentation makes nested IFs readable without changing how they calculate.
- Key Takeaway 4: The IFS function, available in Excel 2019+ and Microsoft 365, removes the need to close multiple brackets and is less prone to off-by-one errors.
- Key Takeaway 5: Data analysts who master conditional logic in Excel often apply the same thinking in Python, SQL and dashboarding tools, all of which are among the highest-paying tech skills in 2026.
How Nested IF Works in Excel
The IF function takes three arguments: a logical test, a value to return when that test is true, and a value to return when it is false. The entire power of how to use if else if in Excel comes from replacing that third argument with another IF function. Excel evaluates from left to right and stops the moment it finds a true condition.
Here is the basic syntax for a single IF:
=IF(logical_test, value_if_true, value_if_false)
When you add a second condition, you replace value_if_false with a new IF:
=IF(logical_test1, value1, IF(logical_test2, value2, default_value))
A Real-World Example: Sales Commission Tiers
Imagine you are building a commission sheet for a sales team in a Bengaluru-based SaaS company. Commission rates are 5% for sales under ₹1,00,000, 8% for ₹1,00,000 to ₹4,99,999, and 12% for ₹5,00,000 and above. The nested IF formula in column C, assuming B2 holds the sales figure, would be:
=IF(B2<100000, B2*0.05, IF(B2<500000, B2*0.08, B2*0.12))
Excel hits the first test. If B2 is less than 1 lakh, done. If not, it moves to the second IF. If B2 is under 5 lakh, done. Otherwise it falls through to 12%. Three outcomes, two IFs, zero ambiguity.
Order of Conditions Matters in a Nested IF Formula
A common mistake is writing conditions in the wrong order. If you test B2<500000 first, every value under 1 lakh also passes that test and gets the 8% rate. Always write conditions from the most restrictive to the least restrictive, or from smallest to largest when working with numeric ranges. This is the kind of error that only shows up when you audit a real dataset, not during a quick sanity check on two rows.
How to Use IF ELSE IF in Excel: Writing an ELSE IF Chain
An else-if chain is just multiple nested IFs stacked in sequence. Each false branch opens a new condition. To add multiple logical tests in Excel this way, keep extending the value_if_false slot. Here is a grade-classification formula used in many Indian universities that follow a 10-point CGPA scale:
=IF(A2>=9,”O”,IF(A2>=7,”A+”,IF(A2>=5.5,”A”,IF(A2>=4,”B+”,”F”))))
Four conditions, four possible labels, one formula. Excel reads it top to bottom: is the CGPA 9 or above? No? Is it 7 or above? And so on until it reaches the default “F”.
Handling Text Conditions
Logical tests do not have to be numeric. You can test text too. Say column A contains department names and you want to assign a budget category:
=IF(A2=”Engineering”,”High”,IF(A2=”Marketing”,”Medium”,”Low”))
Text comparisons in Excel are not case-sensitive by default, so “engineering” and “Engineering” are treated the same. If you need case-sensitive matching, wrap the test in EXACT: =IF(EXACT(A2,”Engineering”),”High”,”Other”).
Combining AND and OR Inside Nested IFs
You can use AND or OR inside any logical test to handle compound conditions. A formula that flags transactions as “High Risk” only when the amount exceeds ₹50,000 and the account age is under 6 months looks like this:
=IF(AND(B2>50000,C2<6),”High Risk”,IF(B2>50000,”Review”,”Clear”))
This is exactly the kind of conditional logic that data analysts apply when filtering records in Excel before moving to more advanced tools. If you are building these skills toward a career move, the guide on data analyst kaise bane explains the full learning path for aspiring analysts in India.
Keeping Nested IFs Readable
A five-level nested IF with no formatting looks like a wall of brackets. The formula still works, but debugging it six months later is painful. Readability is not optional once you are maintaining real spreadsheets shared across a team.
Use Alt+Enter to Add Line Breaks
Click inside the formula bar, position your cursor just before each IF, and press Alt+Enter. Excel inserts a line break inside the formula without breaking the calculation. Then use the spacebar to indent each level. The commission formula from earlier becomes:
=IF(B2<100000, B2*0.05,
IF(B2<500000, B2*0.08,
B2*0.12))
Same result. Far easier to follow. This is the single most underused formatting trick in Excel, and it is the first thing experienced analysts do before sharing a workbook with a client.
Name Your Ranges and Use Helper Columns
Another practical tip: if your thresholds change (a pay revision, a new commission structure), hard-coded numbers inside a formula become a maintenance problem. Put your thresholds in a named range or a helper column, then reference those cells. =IF(B2<Tier1_Max, B2*Rate1, …) reads like a policy document, not a puzzle.
Colour-Code Bracket Pairs
Excel highlights matching bracket pairs in different colours when you click inside a formula. Count your opening brackets, count your closing brackets, they must match. A missing closing bracket is the single most common syntax error in nested IF formulas. If you are getting a #VALUE! error or a formula that just shows as text, check your bracket count first.
Alternatives to Nested IF: IFS, SWITCH and Lookups
Knowing how to use if else if in Excel with nested IFs is essential, but it is not always the best tool. Once you are past three or four conditions, two Excel functions and one technique handle the same job more cleanly.
The IFS Function
IFS, introduced in Excel 2019 and available in Microsoft 365, takes pairs of logical tests and results. There is no nesting, no stacking brackets. The grade formula becomes:
=IFS(A2>=9,”O”, A2>=7,”A+”, A2>=5.5,”A”, A2>=4,”B+”, TRUE,”F”)
The final TRUE,”F” pair acts as the default (the else). IFS is easier to read and easier to extend. According to Microsoft’s official Excel documentation, IFS was added specifically because nested IF formulas became difficult to audit at scale in enterprise spreadsheets.
The SWITCH Function
SWITCH is ideal when you are matching a single value against a list of exact options rather than ranges. It does not handle “greater than” logic well, but for department codes, status labels or category names it is clean:
=SWITCH(A2,”ENG”,”Engineering”,”MKT”,”Marketing”,”FIN”,”Finance”,”Other”)
VLOOKUP and XLOOKUP as Lookup Tables
When you have more than five or six tiers, a lookup table beats any formula. Put your thresholds and labels in a small table on a separate sheet, then use XLOOKUP or VLOOKUP with approximate match to pull the right category. This approach scales to 50 tiers without touching the formula at all, you just update the table.
| Method | Best For | Excel Version | Max Practical Conditions |
|---|---|---|---|
| Nested IF | 2-4 conditions, universal compatibility | All versions | 4-5 |
| IFS | 5-10 conditions, no nesting | Excel 2019, Microsoft 365 | 127 |
| SWITCH | Exact-match lists (status codes, labels) | Excel 2019, Microsoft 365 | 126 pairs |
| XLOOKUP / VLOOKUP | Many tiers, data-driven, easy updates | XLOOKUP: Microsoft 365 only | Unlimited (table rows) |
Knowing which tool fits which situation is exactly what separates a casual Excel user from someone ready to tackle real-world data analytics projects. It is also the kind of judgment that comes up in data analyst interview questions, where interviewers ask you to choose between approaches and explain your reasoning.
Why Excel Still Matters Alongside Python
Python’s Pandas library handles conditional logic with np.where() and pd.cut(), which are conceptually identical to what you are doing with nested IF in Excel. If you are planning to move from Excel into Python-based analysis, the guide on Pandas and NumPy explained shows how the same conditional thinking translates across tools.
According to NASSCOM’s 2024 Future of Work report, over 1.3 million analytics professionals are employed in India, and the majority still use Excel alongside Python or SQL in their daily workflows. LinkedIn’s Jobs on the Rise 2024 report listed data analyst roles among the top 15 fastest-growing jobs in India, with spreadsheet proficiency consistently appearing in job descriptions alongside SQL and Python. According to a 2023 Gartner survey on enterprise productivity tools, Microsoft Excel remains the most widely used data analysis application globally, with over 750 million active users across business functions. These figures confirm that learning how to use if else if in Excel is not a niche skill but a foundational one.
If you are weighing which direction to grow your career, the breakdown of data analyst vs data scientist roles explains how the skill requirements differ and where Excel fits in each path.
Frequently Asked Questions
How do I use IF ELSE IF in Excel?
To use if else if in Excel, nest one IF inside another IF’s third argument, the value_if_false slot. Each nested IF acts as the next else-if branch. Write =IF(test1, result1, IF(test2, result2, default)). Excel evaluates conditions left to right and returns the result of the first true test. There is no separate ELSE IF keyword in Excel.
How many IFs can I nest in Excel?
Excel technically allows up to 64 nested IF functions in a single formula. In practice, anything beyond 4 or 5 levels becomes very hard to read and debug. Microsoft 365 and Excel 2019 users should switch to the IFS function for longer chains, since it removes the bracket-stacking problem entirely.
How do I add multiple logical tests in Excel?
You have three options: nest multiple IF functions in sequence, use the IFS function which takes test-result pairs directly, or combine AND and OR inside a single IF’s logical test to check two conditions at once. For numeric ranges, always order your conditions from most restrictive to least restrictive so the first true match stops evaluation at the right branch.
What is the difference between IF and IFS in Excel?
IF evaluates a single logical test and requires nesting to handle multiple conditions, which means stacking brackets. IFS accepts up to 127 test-result pairs in a flat structure with no nesting required. IFS is easier to read and extend but is only available in Excel 2019 and Microsoft 365. For older Excel versions, nested IF is the only built-in option.
Is IFS better than nested IF?
For more than three or four conditions, yes. IFS is easier to read, easier to extend, and does not require you to count and close multiple brackets. The trade-off is compatibility: IFS only works in Excel 2019 and Microsoft 365. If your workbook needs to open in older versions of Excel, nested IF is still the safe choice.
How do I make a nested IF formula readable?
Use Alt+Enter inside the formula bar to add line breaks before each IF, then use the spacebar to indent each level. Put your threshold values in named cells rather than hard-coding numbers. Give your ranges descriptive names. These three habits turn a confusing string of brackets into something a colleague can audit without asking you to explain it.
Where to go from here: You now know how to use if else if in Excel, how to structure an else-if chain with multiple logical tests, and when to reach for IFS or a lookup table instead. Here are three concrete next steps for this week.
- Open a spreadsheet you already use at work or college, find a column you classify manually, and replace it with a nested IF or IFS formula. Real practice on real data sticks faster than any exercise file.
- Explore the data analytics projects guide to find a project where you can apply conditional logic at scale, then document what you built for your portfolio.
- If you are thinking about where these data skills can take you professionally, check out 3.0 University’s online certification courses in Cybersecurity, AI, Ethical Hacking and Blockchain. Data analysts who can filter logs, build conditional dashboards and flag anomalies are directly valuable in security operations. The EC-Council Certified SOC Analyst course is a strong next step if you want to apply analytical thinking in a cybersecurity context.
Last updated: October 2026. Reviewed by the 3University editorial team.