
Free Excel workbook
Download the IF Practice Workbook
Practice IF formulas, logical tests, and nested IFs with the exact workbook from the tutorial.
Includes example data and finished solutions.
No spam. Unsubscribe anytime.
What Is the IF Function in Excel?
The IF function follows a simple structure:
= IF ( logical_test , [value_if_TRUE] , [value_if_FALSE] )- logical _test – The condition you want to check (e.g., A1>10).
- value_if_TRUE – The result if the condition is TRUE (e.g., a number, text, or another formula).
- value_if_FALSE (optional) – The result if the condition is FALSE. If omitted, Excel returns FALSE by default.
What Is the Syntax of the IF Function?
Think of it as a simple decision-making tool:
📌 IF something is true, THEN return one value, ELSE return another.
What Happens When You Omit value_if_false?
=IF(C2=1, "Hello!")✅ If C2 equals 1, the formula returns “Hello!”.
❌ If not, it returns FALSE (since no value_if_FALSE is specified).
IF Statement with Both Outcomes
If C2 equals 1, the condition is met and the IF formula returns the text “Hello!”. Otherwise, it returns the default value FALSE.
Here is another simple formula with the IF function:
=IF(C3="Hello!", 1, 0)✅ If C3 contains “Hello!”, the formula returns 1.
❌ Otherwise, it returns 0.
This makes the IF function a powerful way to categorize data, set conditions, and automate decisions in Excel.
How Do You Write a Basic IF Formula?
The fastest way to learn the IF function is to build one from scratch. In this example, you will flag every app with revenue above 15,000 as “Good” and leave the rest blank.

How Do You Return Text Based on a Condition?
Step 1. Start the formula.
In cell C5, type:
=IF(Step 2. Define the logical test.
Check whether Revenue in B5 is greater than 15,000:
=IF(B5>15000,Pro tip: reference a cell instead of typing 15,000 directly. If the threshold changes, you update one cell instead of every formula.
=IF(B5>$C$2,Press F4 to lock the reference with dollar signs. Without absolute references, the formula breaks when you copy it down.
Step 3. Set the result when TRUE.
If the condition is met, return “Good”:
=IF(B5>$C$2, "Good",Text values must be wrapped in double quotes. You can also reference a cell that holds the text (like $C$3) so you can change the label later without editing the formula.
=IF(B5>$C$2, $C$3,Step 4. Set the result when FALSE.
If revenue is 15,000 or less, return a blank cell instead of FALSE:
=IF(B5>$C$2, $C$3, "")Two double quotes with nothing between them (“”) tell Excel to display an empty cell.
Step 5. Copy the formula down.
Close the parenthesis, press Enter, then drag the fill handle down to apply the formula to every row. Spot-check a few results against the raw numbers to confirm the logic works.
Featured Course
Excel Essentials for the Real World

How Do You Return Text for a Pass/Fail Result?
Let’s say you want to determine if a student passed or failed based on their score.
Condition: If the score is 50 or higher, they pass. Otherwise, they fail.
Score is in cell B1.
=IF(B1>=50, "Pass", "Fail")✅ If B1 is 50 or more, the formula returns “Pass”.
❌ If B1 is below 50, it returns “Fail”.
How Do You Return a Calculation Instead of Text?
The IF function can also return a calculation instead of just text.
Example: If C1 is under 500, apply an 8% rate. If it’s 500 or more, apply a 10% rate.
=IF(C1 < 500, C1 * 8%, C1 * 10%)✅ If C1 is below 500, it calculates C1 × 8%.
✅ If C1 is 500 or more, it calculates C1 × 10%.
Since IF accepts different data types (numbers, text, dates, or even other formulas), it’s one of Excel’s most versatile functions.
How Do Logical Operators Work with IF?
The IF function evaluates its logical test using six comparison operators. Every IF formula you write uses at least one of these.
| Operator | Meaning | Example | Result when A1 = 50 |
|---|---|---|---|
| = | Equal to | =IF(A1=50,…) | TRUE |
| > | Greater than | =IF(A1>40,…) | TRUE |
| >= | Greater than or equal to | =IF(A1>=50,…) | TRUE |
| < | Less than | =IF(A1<50,…) | FALSE |
| <= | Less than or equal to | =IF(A1<=60,…) | TRUE |
| <> | Not equal to | =IF(A1<>50,…) | FALSE |
The operators work with numbers, text, and dates. Text comparisons are not case-sensitive, so “Yes” and “yes” are treated as equal.
How Do You Create a Pass or Fail Formula?
A common use of the >= operator is grading. If a student scores 50 or higher, they pass. Below 50, they fail.
=IF(B1>=50, "Pass", "Fail")When B1 is 65, the logical test B1>=50 evaluates to TRUE and the formula returns “Pass”. When B1 is 38, the test is FALSE and the formula returns “Fail”.
You can adjust the threshold to any value. For a 70% passing grade, change the formula to:
=IF(B1>=70, "Pass", "Fail")How Do You Apply Different Rates Based on a Value?
Use the < or >= operator to split values into tiers and apply a different calculation to each.
Example: charge 8% on amounts under 500 and 10% on amounts of 500 or more.
=IF(C1<500, C1*8%, C1*10%)| C1 Value | Logical Test C1<500 | Result |
|---|---|---|
| 400 | TRUE | 400 × 8% = 32 |
| 500 | FALSE | 500 × 10% = 50 |
| 1200 | FALSE | 1200 × 10% = 120 |
This pattern appears often in commission structures, tax brackets, and tiered pricing. For three or more tiers, you will need a nested IF or the IFS function, both covered later in this guide.
How Do You Write a Nested IF Statement in Excel?
The IF function is flexible and can be combined with multiple IF functions to evaluate multiple conditions. This is known as a nested IF statement.
📌 How It Works:
- Excel checks the first condition.
- If it’s TRUE, it returns a result.
- If it’s FALSE, Excel moves to the next condition.
- This process continues until all conditions are checked.
Nested IF statements help when you need different outcomes based on multiple conditions.
How Do You Categorize Data with Multiple Conditions?
Let’s say you want to flag revenue values based on thresholds:
- If revenue is over 200, mark it as “flag”.
- If revenue is under 50, mark it as “follow up”.
- Otherwise, leave the cell blank.

= IF(Revenue > 200, "flag", IF(Revenue < 50, "follow up", ""))✅ If Revenue is above 200, the formula returns “flag”.
✅ If Revenue is below 50, it returns “follow up”.
✅ Otherwise, it returns “” (an empty cell).
Why Are Nested IFs Hard to Manage?
While nested IFs are powerful, they can:
- Get complex and difficult to manage.
- Slow down Excel with large datasets.
- Increase the risk of errors, which are hard to debug.
How Many IF Functions Can You Nest?
Excel allows up to 64 nested IF functions in a single formula. This limit applies to Excel 2007 and all later versions, including Microsoft 365. Earlier versions (Excel 2003 and before) had a limit of 7.
In practice, you should rarely nest more than 3 to 5 IF functions. Deeply nested formulas are hard to read, hard to debug, and slow to calculate in large workbooks.
If your formula needs more than a few conditions, use one of these alternatives instead:
- IFS function evaluates multiple conditions in order and returns the first TRUE result. No nesting required. Available in Excel 2019, 2021, 2024, and Microsoft 365.
- SWITCH function compares one value against a list of matches and returns the corresponding result. Cleaner than nested IFs when you are testing the same cell against several exact values.
- XLOOKUP or INDEX/MATCH with a reference table replaces long IF chains entirely. Store your conditions and results in a separate table, then look up the answer.
All three alternatives are covered in detail in the “What Are the Best Alternatives to Nested IF?” section below.
How Do You Use IF with AND in Excel?
The AND function lets you test two or more conditions inside a single IF formula. The formula returns the TRUE result only when every condition is met. If any one condition fails, the formula returns the FALSE result.
The syntax is:
=IF(AND(condition1, condition2), value_if_true, value_if_false)AND accepts up to 255 conditions, but most real-world formulas use 2 or 3.
How Do You Test Two Conditions at Once?
In this example, you want to flag all apps with revenue above 15,000 but under 20,000 as “Good” and leave everything else blank.

The two conditions are:
- Revenue in B5 must be greater than 15,000
- Revenue in B5 must be less than 20,000
Both must be TRUE for the flag to appear. The formula is:
=IF(AND(B5 > $D$2, B5 < $D$3), $C$3, "")| B5 Value | B5 > 15,000 | B5 < 20,000 | AND Result | Formula Returns |
|---|---|---|---|---|
| 12,000 | FALSE | TRUE | FALSE | (blank) |
| 17,500 | TRUE | TRUE | TRUE | “Good” |
| 22,000 | TRUE | FALSE | FALSE | (blank) |
The AND function evaluates both conditions first. Only when both return TRUE does the IF function return “Good”. In every other case, the formula returns an empty string.
Copy the formula down the full range with the fill handle. The absolute references ($D$2, $D$3, $C$3) stay locked while B5 adjusts to each row.
How Do You Combine IF AND with a Nested IF?
You can place a second IF inside the FALSE argument to handle an additional tier.
This example flags revenue between 15,000 and 20,000 as “Good” and revenue of 20,000 or above as “Exceptional”. Everything else shows the raw revenue number.

=IF(AND(B5>$E$2, B5<$E$3), $C$3, IF(B5>=$E$3, "Exceptional", B5))Here is how Excel evaluates this formula step by step:
- First, AND checks whether B5 is above 15,000 and below 20,000.
- If both are TRUE, the formula returns “Good”.
- If AND returns FALSE, Excel moves to the second IF and checks whether B5 is 20,000 or above.
- If that test is TRUE, the formula returns “Exceptional”.
- If both tests fail, the formula returns the raw value in B5.
| B5 Value | B5 > 15,000 | B5 < 20,000 | AND Result | Formula Returns |
|---|---|---|---|---|
| 12,000 | FALSE | TRUE | FALSE | 12,000 |
| 17,500 | TRUE | TRUE | TRUE | “Good” |
| 22,000 | TRUE | FALSE | FALSE | “Exceptional” |
For three or more tiers, consider using IFS or a lookup table instead of adding more nesting. Both approaches are covered in the alternatives section below.
How Do You Use IF with OR in Excel?
The OR function tests two or more conditions and returns TRUE when at least one condition is met. Combined with IF, it lets you flag values that fall into either of two ranges.
The syntax is:
=IF(OR(condition1, condition2), value_if_true, value_if_false)Like AND, OR accepts up to 255 conditions. The key difference: AND requires every condition to be TRUE, while OR requires only one.
How Do You Flag Values That Meet Either Condition?
In this example, you want to flag all apps where revenue is 15,000 or below OR 20,000 or above. Values between 15,000 and 20,000 stay blank.

The two conditions are:
- Revenue in B5 is less than or equal to 15,000
- Revenue in B5 is greater than or equal to 20,000
Only one needs to be TRUE for the flag to appear. The formula is:
=IF(OR(B5 <= $F$2, B5 >= $F$3), "Flag", "")| B5 Value | B5 <= 15,000 | B5 >= 20,000 | OR Result | Formula Returns |
|---|---|---|---|---|
| 12,000 | TRUE | FALSE | TRUE | “Flag” |
| 17,500 | FALSE | FALSE | FALSE | (blank) |
| 22,000 | FALSE | TRUE | TRUE | “Flag” |
The OR function checks both conditions. When at least one returns TRUE, the IF function returns “Flag”. When neither condition is met, the formula returns an empty string.
Copy the formula down with the fill handle. The absolute references ($F$2, $F$3) stay locked on each row.
When Should You Use OR Instead of AND?
AND and OR solve opposite problems. Use this rule:
- AND when the value must fall inside a range (above X and below Y)
- OR when the value must fall outside a range (below X or above Y)
A quick comparison using the same thresholds of 15,000 and 20,000:
| Formula | What It Flags | B5 = 17,500 | B5 = 22,000 |
|---|---|---|---|
| =IF(AND(B5>15000, B5<20000), “Flag”, “”) | Values between 15,000 and 20,000 | “Flag” | (blank) |
| =IF(OR(B5<=15000, B5>=20000), “Flag”, “”) | Values outside 15,000 to 20,000 | (blank) | “Flag” |
If you need to combine AND and OR in the same formula, nest one inside the other:
=IF(AND(B5 >= 10000, OR(C5 = "East", C5 ="West")), "Flag", "")This flags rows where revenue is 10,000 or above AND the region is either “East” or “West”. The OR resolves firs
How Do You Use Other Formulas Inside IF?
The value_if_true and value_if_false arguments accept any valid Excel expression. That means you can place calculations, text functions, lookups, and even other formulas inside an IF. Excel evaluates the inner expression first, then IF decides which result to return.
This is what makes IF one of the most flexible functions in Excel. The examples below show two common patterns: embedding a calculation in the logical test and embedding a cell reference that returns a visual symbol.
How Do You Flag Deviations Greater Than 10%?
A common finance task is comparing actual revenue against a budget and flagging any variance that exceeds a threshold.
In this example, you want to show the exact deviation when it is larger than +10% or smaller than -10%, and leave the cell blank otherwise.

The core calculation is:
=B23/C23 - 1This divides Actual Revenue (B23) by Budget Revenue (C23) and subtracts 1 to get the percentage difference. A result of 0.15 means actual was 15% above budget. A result of -0.08 means actual was 8% below.
Wrap that calculation inside an IF with OR to test both directions:
=IF(OR(B23/C23-1>10%, B23/C23-1<-10%), B23/C23-1, "")| Actual (B23) | Budget (C23) | Deviation | Greater Than 10%? | Less Than -10%? | Formula Returns |
|---|---|---|---|---|---|
| 11,500 | 10,000 | 15% | TRUE | FALSE | 0.15 |
| 9,500 | 10,000 | -5% | FALSE | FALSE | (blank) |
| 8,000 | 10,000 | -20% | FALSE | TRUE | -0.20 |
Format the result column as Percentage so 0.15 displays as 15%.
Pro tip: The formula calculates B23/C23-1 three times (twice in the OR test, once in the TRUE result). In a large workbook, you can use the LET function to calculate it once and reuse the result:
=LET(dev, B23/C23-1, IF(OR(dev>10%, dev<-10%), dev, ""))LET assigns the name “dev” to the calculation, then references it in the IF. The result is identical but the formula is shorter and evaluates faster. LET is available in Excel 2021, 2024, and Microsoft 365.
How Do You Display Icons Based on IF Results?
Instead of returning text or numbers, you can make IF return a symbol stored in a cell. This is useful for dashboards where a visual indicator is easier to scan than a number.
In this example, positive deviations above 10% get an up arrow and negative deviations below -10% get a down arrow. Values within the threshold stay blank.

Step 1. Insert the symbols.
Place an up arrow in cell A20 and a down arrow in cell A21. To insert a symbol, go to Insert > Symbol, select the Arial font, and browse the Geometric Shapes subset.
Pick a triangle or arrow, click Insert, then close the dialog.

Step 2. Build the formula.
Use a nested IF that references the symbol cells:
=IF(B23/C23-1>10%, $A$20, IF(B23/C23-1<-10%, $A$21, ""))Here is how Excel evaluates this:
- First IF checks whether the deviation exceeds +10%.
- If TRUE, returns the up arrow stored in $A$20.
- If FALSE, the second IF checks whether the deviation is below -10%.
- If TRUE, returns the down arrow stored in $A$21.
- If both tests fail, returns a blank cell.
Copy the formula down the full range. The absolute references keep the symbol cells locked.
Alternative approach: Excel’s built-in Conditional Formatting has an Icon Sets option (Home > Conditional Formatting > Icon Sets) that applies directional arrows automatically based on cell values.
Icon Sets require no formulas and update when your data changes, but they offer less control over the thresholds and symbol choices than the IF method shown here.
What Are the Best Alternatives to Nested IF?
Nested IF formulas work, but they get difficult to read and maintain beyond 3 conditions. Excel now offers several functions that handle multiple conditions more cleanly. Each one solves a different problem.
| Function | Best For | Available In |
|---|---|---|
| IFS | Testing multiple conditions in order | Excel 2019, 2021, 2024, Microsoft 365 |
| SWITCH | Matching one value against a list of exact matches | Excel 2019, 2021, 2024, Microsoft 365 |
| LET | Naming repeated calculations inside any formula | Excel 2021, 2024, Microsoft 365 |
| LAMBDA | Creating reusable custom functions | Excel 2024, Microsoft 365 |
When Should You Use IFS Instead of Nested IF?
The IFS function tests multiple conditions in sequence and returns the result for the first condition that is TRUE. No nesting required.
The syntax is:
=IFS(condition1, value1, condition2, value2, condition3, value3)Example: assign a letter grade based on a score in B2.
Nested IF version:
=IF(B2>=90, "A", IF(B2>=80, "B", IF(B2>=70, "C", IF(B2>=60, "D", "F"))))IFS version:
=IFS(B2>=90, "A", B2>=80, "B", B2>=70, "C", B2>=60, "D", TRUE, "F")Both return the same result. The IFS version is flat, easier to read, and easier to edit when you need to add or remove a tier.
The final TRUE acts as a default catch-all, equivalent to the last value_if_false in a nested IF. IFS supports up to 127 condition/value pairs.
Learn more in our full guide to the Excel IFS function with examples.

When Should You Use SWITCH Instead of IF?
The SWITCH function compares one value against a list of exact matches and returns the corresponding result. It replaces nested IFs when you are testing the same cell against specific values rather than ranges.
The syntax is:
=SWITCH(expression, match1, result1, match2, result2, …, default)Example: convert a department code in A2 to a full department name.
Nested IF version:
=IF(A2="FIN", "Finance", IF(A2="MKT", "Marketing", IF(A2="OPS", "Operations", "Unknown")))SWITCH version:
=SWITCH(A2, "FIN", "Finance", "MKT", "Marketing", "OPS", "Operations", "Unknown")SWITCH is cleaner because you write the lookup expression (A2) once. With nested IF, you repeat A2 in every condition.
Use SWITCH for exact matches only. It does not support operators like > or <. For range-based conditions, use IFS.

How Do LET and LAMBDA Simplify Complex IF Logic?
The LET function lets you assign names to intermediate calculations inside a formula. This avoids repeating the same expression multiple times and makes long formulas easier to read.
Example: flag budget deviations above 10% in either direction. Without LET, the deviation calculation (B2/C2-1) appears three times:
=IF(OR(B2/C2-1>10%, B2/C2-1<-10%), B2/C2-1, "")With LET, you calculate it once:
=LET(dev, B2/C2-1, IF(OR(dev>10%, dev<-10%), dev, ""))LET names the result “dev” and reuses it everywhere. The logic is identical but the formula is shorter, faster, and easier to audit.
The LAMBDA function goes one step further. It lets you create a reusable custom function that you can call by name anywhere in the workbook.
Example: define a custom function called GRADE that takes a score and returns a letter.
- Step 1. Go to Formulas > Name Manager > New.
- Step 2. In the Name field, type GRADE.
- Step 3. In the Refers to field, enter:
=LAMBDA(score, IFS(score>=90,"A", score>=80,"B", score>=70,"C", score>=60,"D", TRUE,"F"))- Step 4. Click OK.

Now you can use the new Lambda function in any cell:
=GRADE(B2)
The formula is clean, reusable, and self-documenting.
LAMBDA is available in Excel 2021, 2024, and Microsoft 365. It is especially useful when the same IF logic applies across multiple sheets or workbooks.
How Does Copilot Help You Write IF Formulas in Excel?
Microsoft 365 Copilot can generate, explain, and troubleshoot IF formulas directly inside Excel. The feature that handles formula work is called Edit with Copilot. It requires a Microsoft 365 Copilot license or an eligible Microsoft 365 subscription.
Note: Microsoft previously called this feature “Agent Mode.” That name was retired in early 2026. The current name in the Excel interface is Edit with Copilot.
What Is Edit with Copilot in Excel?
Edit with Copilot lets you describe what you want in plain language, and Copilot builds the formula, applies it to your workbook, and explains how it works.
How to use it:
- Open the Copilot pane from the Home tab.
- Make sure editing is enabled. You will see an Excel icon in the chat box when Copilot is ready to edit. If it is not active, click the Tools menu below the chat box and select Edit with Copilot.
- Type a request in natural language. For example: “Add a column that returns Pass when Score is 50 or above, otherwise Fail.”
- Copilot generates the IF formula, inserts the column, and applies the formula to every row.
- Review the result. You can accept, undo, or ask Copilot to refine it.
Edit with Copilot works with tables, formulas, charts, and PivotTables. It can handle multi-step tasks like building a grading scale with nested IFs, applying conditional formatting based on IF results, or restructuring data across sheets.
This feature is generally available in Excel for Windows, Mac, and the web for Microsoft 365 Copilot users.
Can Copilot Explain or Fix an IF Formula?
Yes. You can ask Copilot to break down an existing formula in plain language.
How to explain a formula:
- Select the cell containing the IF formula.
- Open the Copilot pane and type: “Explain how this formula works.”
- Copilot returns a step-by-step breakdown of the logic, including what each nested IF tests and what it returns.
This is especially useful for deeply nested IFs where the logic is hard to trace by reading the formula bar alone.
You can also ask Copilot to fix a broken formula. Type something like: “The formula in D2 returns FALSE when I expect a blank cell. Fix it.” Copilot will identify the missing value_if_false argument and update the formula with “”.
Copilot Chat (without editing enabled) can also answer questions about your data and explain formulas, but it will not make changes to the workbook directly.
Use Edit with Copilot when you want formulas applied, and Copilot Chat when you just need an explanation.
What Are Common IF Function Errors and How Do You Fix Them?
IF formulas can return unexpected results or error values when the syntax, data types, or references are wrong. Below are the three most common problems and how to fix each one.
Why Does My IF Formula Return #NAME?
The #NAME? error means Excel does not recognize something in your formula. In IF formulas, this almost always happens when text in the value_if_true or value_if_false argument is not wrapped in double quotes.
Broken formula:
=IF(A1>10, Pass, Fail)Excel reads Pass and Fail as undefined named ranges and returns #NAME?.
Fixed formula:
=IF(A1>10, "Pass", "Fail")Double quotes tell Excel to treat Pass and Fail as text strings.
Other causes of #NAME? in IF formulas:
- A misspelled function name, such as =IFF instead of =IF
- A missing colon in a range reference, such as A1A10 instead of A1:A10
- Using a function that is not available in your Excel version, such as IFS in Excel 2016
Why Does My IF Formula Return FALSE Instead of Blank?
When you omit the third argument (value_if_false), Excel returns the default value FALSE.
Example:
=IF(A1>100, "Over budget")If A1 is 80, this formula returns FALSE because no value_if_false was specified.
To return a blank cell instead, add an empty string as the third argument:
=IF(A1>100, "Over budget", "")The two double quotes with nothing between them tell Excel to display nothing. This is the standard way to keep cells visually clean when the condition is not met.
When Should You Use IFERROR or IFNA with IF?
IF tests a condition you define. It does not catch errors produced by other functions nested inside it.
Example: this formula returns #N/A when VLOOKUP cannot find the lookup value, even though it is wrapped in IF.
=IF(A1<>"", VLOOKUP(A1, Data!A:B, 2, FALSE), "")The IF only checks whether A1 is empty. It does not handle the #N/A that VLOOKUP returns when the value is not in the lookup table.
To catch that error, wrap the VLOOKUP in IFERROR:
=IF(A1<>"", IFERROR(VLOOKUP(A1, Data!A:B, 2, FALSE), "Not found"), "")| Function | What It Catches | Use It When |
|---|---|---|
| IFERROR | All error types (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, #NULL!) | You want a single fallback for any error |
| IFNA | Only #N/A errors | You want to handle missing lookup values but still see other errors that may indicate a real problem |
IFNA is the better choice for lookups because it does not mask unexpected errors like #REF! or #DIV/0! that might point to a broken formula elsewhere in the workbook.
IFERROR is available in Excel 2007 and later. IFNA was introduced in Excel 2013 and is available in Excel 2013 and later.
Frequently Asked Questions About the Excel IF Function
What does the IF function do in Excel?
The IF function tests a condition and returns one value when the result is TRUE and a different value when it is FALSE. The syntax is =IF(logical_test, value_if_true, value_if_false).
It is available in every version of Excel from 2007 through Microsoft 365.
Can the IF function check text values?
Yes. Use double quotes around the text in the logical test. For example, =IF(A1=”Yes”, “Approved”, “Pending”) checks whether A1 contains the word “Yes”. Text comparisons in IF are not case-sensitive, so “Yes”, “yes”, and “YES” are all treated as equal.
How many IF statements can you nest in Excel?
Excel supports up to 64 nested IF functions in a single formula. This limit applies to Excel 2007 and all later versions. Earlier versions allowed a maximum of 7.
For formulas with more than 3 to 5 conditions, use IFS or SWITCH instead.
What is the difference between IF and IFS?
IF tests one condition and returns one of two results. IFS tests multiple conditions in sequence and returns the result for the first TRUE condition, without nesting.
IFS is available in Excel 2019, 2021, 2024, and Microsoft 365.
Can Copilot write IF formulas for me?
Yes. In Microsoft 365, Edit with Copilot lets you describe the logic
you need in plain language and Copilot generates and applies the IF
formula to your workbook.
Open the Copilot pane from the Home tab, make sure editing is enabled, and type your request. A Microsoft 365 Copilot license or eligible Microsoft 365 subscription is required.
Why does my IF formula return 0 instead of a blank cell?
This happens when you omit the value_if_true argument. For example, =IF(A1>10, , “No”) returns 0 when A1 is greater than 10 because the second argument is empty.
To fix this, add an explicit value such as “Yes” or an empty string (“”) if you want the cell to appear blank.
Does the IF function work in Google Sheets?
Yes. The IF function uses the same syntax and logic in Google Sheets as it does in Excel. The main differences are in the newer alternatives: IFS and SWITCH are available in Google Sheets, but LET and LAMBDA may have different availability or syntax variations.
Workbook for Download
Download the IF Function Practice File
Practice building logical tests and nested IFs using the exact workbook from the tutorial.
Featured Course
Master Excel’s Essential Modern Functions

Leila Gharani
Founder of XelPlus and ten-time Microsoft MVP. Leila helps over 500,000 professionals master Excel, Power BI, and data automation through practical, real-world training.







