How to use if else formula in Excel: Use =IF(logical_test, value_if_true, value_if_false). The third argument is your ELSE branch. If the condition is true, Excel returns the second argument; if false, it returns the third. Excel has no separate ELSE keyword — the IF function handles the entire if-then-else structure on its own.
Key Takeaways
- Excel’s IF function replaces both the IF and ELSE keywords you’d find in a programming language.
- The value_if_false argument is your ELSE branch. Leave it blank and Excel returns FALSE by default.
- Nested IFs let you add multiple else conditions, but IFS and SWITCH are cleaner for three or more branches.
- Forgetting to close every bracket is the single most common mistake that breaks if-else formulas.
- Data analysts use if-else logic daily for grading, flagging anomalies, calculating bonuses and classifying records.
How IF Handles Else Logic
In Python or JavaScript, you write if ... else ... as two separate statements. Excel collapses both into a single function. The IF function takes three arguments: a logical test, what to return when it’s true, and what to return when it’s false. That third argument is your else branch — and that is the core of how to use if else formula in Excel.
The full syntax looks like this:
| Argument | What it means | Example |
|---|---|---|
| logical_test | Any condition that evaluates to TRUE or FALSE | A2>=60 |
| value_if_true | Returned when the condition is TRUE | “Pass” |
| value_if_false | Returned when the condition is FALSE (your ELSE) | “Fail” |
So =IF(A2>=60,"Pass","Fail") is a complete if-then-else rule. If A2 is 60 or above, the cell shows “Pass”. If it isn’t, it shows “Fail”. No separate ELSE keyword needed.
Does Excel have an ELSE function?
No, and it doesn’t need one. The value_if_false parameter inside IF does exactly what ELSE does in code. Microsoft’s own official IF function documentation confirms that the third argument is optional but defaults to FALSE when omitted. In practice, always supply it explicitly so your spreadsheet doesn’t silently return a Boolean where you expected text or a number.
The if-then rule in plain English
Think of every Excel IF formula as a sentence: “If this is true, then do this, else do that.” That mental model maps directly to how the excel rule if then structure works. Once you see it that way, writing the excel if then else formula becomes straightforward, even for beginners.
IF THEN ELSE Formula Examples
Real formulas are easier to remember than abstract syntax. Here are four practical examples of how to use if else formula in Excel — from student grading to sales bonuses — that you’d actually use in a spreadsheet.
Example 1: Pass or Fail (Student Marks)
Imagine a college in Pune has students’ marks in column B. The pass mark is 40 out of 100. To flag each student:
=IF(B2>=40,"Pass","Fail")
Drag it down column C and every row instantly gets a Pass or Fail label. This is the simplest excel if else example you’ll see, and it works identically in Excel 2016, 2019, 2021 and Microsoft 365.
Example 2: Overdue Invoice Status
An accounts team tracking payments can flag overdue invoices. If column D holds the due date and today’s date is past it, the invoice is overdue:
=IF(D2<TODAY(),"Overdue","On Time")
This excel if else condition formula updates automatically every day because TODAY() is dynamic. No manual checking required.
Example 3: Sales Bonus Calculation
A sales manager wants to pay a 10% bonus to anyone who hit their monthly target of Rs 5,00,000. Column E holds actual sales:
=IF(E2>=500000,E2*0.1,0)
Here the value_if_false is 0, meaning no bonus. The formula returns a rupee amount for top performers and zero for everyone else. This is a classic excel if then else formula example used in HR and finance teams across India’s BFSI and IT services sectors.
Example 4: Attendance Flag
An HR spreadsheet holds attendance percentage in column F. Company policy requires at least 75%:
=IF(F2>=75,"Eligible","Not Eligible")
Simple, clean, and instantly readable by anyone opening the sheet.
Chaining Multiple Else Branches
One IF gives you two outcomes. Real data often needs three, four or five. That’s where nested IFs and the IFS function come in. Knowing when to use each one saves you hours of debugging.
Nested IF for Grade Letters
To assign grade letters (A, B, C, D, F) based on marks, you place an IF inside the value_if_false of the previous IF. This is how to add multiple else conditions in Excel:
=IF(A2>=90,"A",IF(A2>=75,"B",IF(A2>=60,"C",IF(A2>=40,"D","F"))))
Excel evaluates left to right. The first condition that’s true wins. Every subsequent IF is the “else” branch of the one before it. You can nest up to 64 IFs in modern Excel, though anything beyond five becomes hard to read and maintain.
Using IFS Instead of Nested IF
The IFS function, available in Excel 2019 and Microsoft 365, was built specifically to flatten nested IFs. The same grade formula becomes:
=IFS(A2>=90,"A",A2>=75,"B",A2>=60,"C",A2>=40,"D",TRUE,"F")
The TRUE,"F" at the end acts as the catch-all else branch. It’s much easier to read and audit. If you’re working in Excel 2016 or older, stick with nested IFs since IFS isn’t available there.
SWITCH for Exact Match Logic
When your condition tests one cell against a list of exact values, rather than ranges, the SWITCH function is cleaner. For example, mapping department codes to full names:
=SWITCH(B2,"HR","Human Resources","IT","Information Technology","FIN","Finance","Unknown")
The last argument is the default, which is your else. SWITCH doesn’t handle greater-than or less-than comparisons, so use IFS for range-based logic and SWITCH for exact matches.
How nested IF compares to IFS and SWITCH
The table below summarises which excel conditional formula function to use based on your scenario, version and number of conditions.
| Function | Best for | Max conditions | Available in |
|---|---|---|---|
| Nested IF | Range-based logic, older Excel | 64 | All versions |
| IFS | Multiple range conditions, readable | 127 | Excel 2019, Microsoft 365 |
| SWITCH | Exact value matching | 126 | Excel 2019, Microsoft 365 |
Microsoft 365 is now the dominant version in Indian corporate environments. According to Statista (2024), Microsoft Office holds over 48% of the global productivity software market, meaning most workplaces where you’ll apply these formulas are running a version that supports IFS and SWITCH.
Excel proficiency is also increasingly tied to job prospects. According to LinkedIn’s Jobs on the Rise in India 2024 report, data analyst ranked among the fastest-growing roles in the country, with Excel and spreadsheet skills appearing in the top five required competencies for the role. If you’re thinking about a career shift, our guide on how to become a data analyst in India walks through exactly what skills matter and in what order.
NASSCOM’s Future of Work 2023 report found that data-related roles are expected to account for over 11 million jobs in India by 2026, with analytical and spreadsheet skills listed as baseline requirements across sectors from banking to logistics. That context matters: every excel if else formula example you practise today has direct job-market value.
Want to build on these skills with structured learning? Browse the full 3.0 University online certification courses catalogue to find the programme that fits your goals.
Common If-Else Mistakes
Even experienced users make the same errors with if-else formulas. Spotting them early saves a lot of frustration.
Mistake 1: Mismatched Brackets
Every IF needs one opening and one closing bracket. A nested IF with four levels needs four closing brackets at the end: )))). Excel highlights unmatched brackets in red when you press Enter, but it doesn’t always tell you which bracket is wrong. Count them manually before submitting any complex formula.
Mistake 2: Text Without Quotes
Text values inside IF must be wrapped in double quotes. Writing =IF(A2>=60,Pass,Fail) throws a #NAME? error because Excel treats Pass and Fail as undefined names. It must be =IF(A2>=60,"Pass","Fail"). Numbers, on the other hand, don’t need quotes.
Mistake 3: Wrong Condition Order in Nested IFs
This one is subtle. If you put a lower threshold first in a nested IF, every higher value gets caught by it before reaching the correct branch. For example, putting A2>=40 before A2>=90 means a score of 95 gets labelled “D” instead of “A”. Always start with the highest threshold and work downward.
Mistake 4: Omitting the value_if_false
Leaving out the third argument isn’t an error, but it’s rarely intentional. =IF(A2>=60,"Pass") returns FALSE for anyone who fails, not a blank or zero. In a real spreadsheet, a stray FALSE in a column of text labels causes confusion and breaks downstream formulas. Always define what happens in the else branch explicitly.
These mistakes come up constantly in data analyst interview questions. Interviewers often hand candidates a broken formula and ask them to fix it. Knowing these four failure modes puts you well ahead. Check out our full list of data analyst interview questions to see what else hiring managers test.
Understanding how to use if else formula in Excel is also a foundation for more advanced analytical work. Once you’re comfortable with excel logical functions and conditional formulas, tools like Python’s Pandas library feel much more intuitive. Our guide on Pandas and NumPy shows how the same if-else thinking translates into Python code for larger datasets.
If you want to apply these skills on real projects, our data analytics projects guide has hands-on ideas you can start this week using nothing but Excel and publicly available datasets.
It’s also worth understanding where Excel fits in a broader data career. Our breakdown of data analyst vs data scientist roles clarifies which path suits your goals, and our roundup of highest paying tech skills in 2026 shows how data skills stack up against cloud, AI and security competencies in terms of salary.
Frequently Asked Questions
How do I write IF ELSE in Excel?
Use the IF function with three arguments: =IF(logical_test, value_if_true, value_if_false). The third argument is your ELSE branch. For example, =IF(A2>=60,"Pass","Fail") returns “Pass” when A2 is 60 or above and “Fail” for anything lower. There is no separate ELSE keyword in Excel.
Does Excel have an ELSE function?
No, Excel doesn’t have a standalone ELSE function or keyword. The value_if_false parameter of the IF function serves as the ELSE branch. If you omit it, Excel returns FALSE by default, which is rarely what you want, so always supply a value explicitly.
How do I write IF THEN in Excel?
The IF function covers both the IF and THEN parts. Write =IF(condition, result_if_true, result_if_false). The second argument is your THEN result. For example, =IF(B2>500000, B2*0.1, 0) reads as: “If sales exceed five lakh, then pay 10% bonus, else pay nothing.”
How do I add multiple else conditions in Excel?
Place another IF inside the value_if_false argument to create a nested IF. For three or more conditions in Excel 2019 or Microsoft 365, use the IFS function instead, which is easier to read and audit. Always start with your highest threshold and work down to avoid misclassification errors.
What is the IF THEN ELSE formula in Excel?
The IF THEN ELSE formula in Excel is =IF(logical_test, value_if_true, value_if_false). It’s a single function that maps directly to the if-then-else structure used in programming languages. The logical test is your IF condition, the second argument is THEN, and the third argument is ELSE.
Can I use IF with AND or OR in Excel?
Yes. Wrap AND or OR inside the logical_test argument. For example, =IF(AND(A2>=40,B2>=40),"Pass","Fail") requires both conditions to be true. =IF(OR(A2>=40,B2>=40),"Pass","Fail") requires only one. This extends the excel if else condition formula to handle compound rules.
What is the difference between IFS and nested IF in Excel?
Both handle multiple conditions, but IFS is easier to read and supports up to 127 condition pairs. Nested IF buries each additional condition inside the previous one’s false branch, making formulas harder to audit beyond four or five levels. Use IFS in Excel 2019 or Microsoft 365; use nested IF in older versions.
Now you know how to use if else formula in Excel, from a single condition to multi-branch logic with IFS and SWITCH. The next step is practising on real data, then connecting these skills to broader analytical work.
- Open a blank Excel sheet and recreate all four examples from this article using your own sample numbers. Mistakes you make on practice data are lessons, not problems.
- Try converting a nested IF formula into an IFS formula. Notice how much easier it is to read and where the catch-all TRUE argument sits.
- If you want to take these data skills into a career in security analytics, SOC work or threat intelligence, explore the EC-Council Certified SOC Analyst course at 3.0 University. SOC analysts use conditional logic every day to filter logs, build alert rules and classify threats, exactly the same thinking behind every IF formula you just wrote.
Last updated: June 2025. Reviewed by the 3University editorial team.