IF and IFS Functions in Excel: Complete Guide with Practical Examples

Learning IF and IFS in Excel is one of the most useful steps you can take after mastering basic spreadsheet formulas. These functions turn ordinary data into decisions, whether you are checking exam scores, monitoring sales targets, tracking project budgets or classifying risks. Instead of manually reviewing every row, you can define a rule and let Excel return a consistent result.

In this guide, you will learn how to build conditional formulas from scratch, combine multiple conditions and avoid common mistakes. Moreover, you can download a free practice workbook to test each technique yourself. If you are new to spreadsheets, start with our Excel for beginners guide before working through the examples.

What Are IF and IFS in Excel?

The IF function checks a condition and returns one value when that condition is true and another value when it is false. For example, you might want Excel to display Pass when a student’s score reaches 50, or Fail when the score is below 50. The underlying score remains unchanged; the formula simply produces a useful interpretation.

IFS extends this idea by allowing several condition-and-result pairs in one formula. Consequently, you can classify a score into four categories without writing several IF functions inside one another. Excel returns the result associated with the first true condition in the order you specify.

Both functions are part of Excel’s logical function family. However, they solve slightly different problems. IF is ideal when there are two possible outcomes, while IFS is useful when several rules determine the result. You can also combine IF with other functions to express more complex business decisions.

Microsoft provides official references for the IF function and IFS function. For a broader foundation, explore our Excel formulas and functions guide. Throughout this article, formulas use English function names and comma separators; your regional settings may require semicolons instead.

Understanding Logical Tests for IF and IFS in Excel

A logical test is an expression that produces either TRUE or FALSE. For instance, the expression B2>=50 asks whether the number stored in B2 is at least 50. When B2 contains 78, the expression is true. When it contains 42, it is false.

Comparison operators you need to know

Excel uses six common comparison operators: = means equal to; <> means not equal to; > means greater than; < means less than; >= means greater than or equal to; and <= means less than or equal to. Importantly, the choice between greater than and greater than or equal to determines what happens at the boundary.

=B2>=50
=B2=50
=B2<>50
=B2<50

Try entering these expressions in empty cells with B2 set to 50. The first two return TRUE, while the third and fourth return FALSE. Next, change B2 to 49 and observe the results. This small exercise helps you understand the condition independently of the IF function.

Logical tests also work with text. For example, C2=”Completed” checks whether the cell contains that status. Text constants require double quotation marks, whereas ordinary numeric values do not. Therefore, write 50 for a numeric threshold and “Completed” for a text label.

Before writing a conditional formula, express the rule in plain language. Decide which input cell matters, what comparison should be made and how equality should be treated. This habit makes your formulas easier to review, especially when several people use the same spreadsheet.

How the IF Function Works

The IF function has three arguments: a logical test, a value to return when the test is true, and a value to return when the test is false. The following syntax summarizes the relationship between these arguments.

=IF(logical_test,value_if_true,value_if_false)

Suppose column A contains student names, column B contains scores and column C displays results. Select C2 and enter the following formula. Then press Enter to calculate the result.

=IF(B2>=50,"Pass","Fail")

Here, B2>=50 is the logical test. If the score is 50 or more, Excel returns Pass. Otherwise, it returns Fail. Notice that the formula references B2 rather than C2, because C2 is the output cell. Referencing C2 from its own formula would create a circular reference.

For example, a score of 85 returns Pass, a score of 42 returns Fail and a score of exactly 50 returns Pass. As a result, the threshold behaves consistently for every student.

To apply the same rule to additional rows, select C2 and drag the fill handle down the result column. Excel adjusts relative references automatically, so the next row checks B3, followed by B4. Alternatively, convert the dataset into an Excel table so formulas can extend as new records are added.

If you want a configurable threshold, enter 50 in E1 and use an absolute reference to that cell. This approach separates the business rule from the calculation and avoids changing dozens of formulas when the threshold changes.

=IF(B2>=$E$1,"Pass","Fail")

The dollar signs keep E1 fixed as the formula is copied down. Meanwhile, B2 changes to the corresponding row. This combination of relative and absolute references is especially valuable in shared workbooks.

Excel IF function decision flow showing pass and fail results

Practical IF Function Examples

Example 1: Check a sales target

Assume B2 contains actual sales and C2 contains the target. In D2, enter a formula that reports whether the salesperson reached the target. For example, actual sales of 12,000 against a target of 10,000 should return Target met.

=IF(B2>=C2,"Target met","Below target")

If actual sales equal the target, the result is still Target met. However, a lower value returns Below target. You can use this same pattern for service levels, training completion or monthly performance indicators.

Example 2: Calculate commission

A conditional formula can return a number instead of text. Suppose B2 stores sales, C2 stores the minimum target and D2 stores a commission rate of 5%. The following formula returns the commission amount when the target is reached and zero otherwise.

=IF(B2>=C2,B2*D2,0)

With sales of 12,000 and a target of 10,000, the commission is 600. In contrast, sales below the target produce zero. Format the result as currency and the rate as a percentage to make the spreadsheet easier to interpret.

Example 3: Handle missing scores

Blank cells deserve special attention because Excel can treat an empty reference like zero in a numeric comparison. Consequently, an unfinished record could appear as Fail even though nobody has entered a score. Add a preliminary test to preserve an empty result until data arrives.

=IF(B2="","",IF(B2>=50,"Pass","Fail"))

This formula returns an empty string for a missing score. Otherwise, it applies the pass rule. A genuine numeric zero still returns Fail. However, a cell containing spaces is not genuinely empty, so clean inconsistent inputs before relying on the result.

Example 4: Monitor stock levels

For an inventory tracker, place available quantity in B2 and the reorder threshold in C2. The following formula signals that replenishment is needed when stock reaches or falls below the threshold.

=IF(B2<=C2,"Reorder","Available")

If the threshold is 10, a quantity of exactly 10 returns Reorder. Similarly, a quantity of 8 triggers the same result. Later, you can extend this formula to distinguish an out-of-stock item from one that merely needs replenishment.

Nested IF Functions

A nested IF places one IF function inside another. This makes it possible to produce more than two results while retaining compatibility with older versions of Excel. For instance, consider four score categories: Excellent for 90 or more, Good for 75 or more, Pass for 50 or more, and Fail for anything below 50.

=IF(B2>=90,"Excellent",IF(B2>=75,"Good",IF(B2>=50,"Pass","Fail")))

The first condition checks the highest threshold. If it is false, the next IF checks whether the score reaches 75. If that condition is also false, the last IF checks whether it reaches 50. Otherwise, the formula returns Fail.

For a score of 78, the first test is false and the second is true, so the result is Good. Likewise, 90 returns Excellent, 75 returns Good, 50 returns Pass and 49 returns Fail. Testing these boundary values is more informative than testing only scores comfortably inside each category.

Order matters when conditions overlap. If you check B2>=50 before B2>=90, a score of 95 meets the first condition and receives Pass instead of Excellent. Therefore, descending thresholds are the appropriate order for this particular classification rule.

Nested IF remains useful when an organization still uses an Excel version without IFS. However, deeply nested formulas are harder to read, maintain and troubleshoot. When rules grow more complicated, consider IFS or a separate lookup table instead.

How the IFS Function Works

The IFS function accepts a sequence of logical tests and corresponding return values. Unlike nested IF, it presents these pairs in a relatively flat structure. As a result, you can often see the entire classification policy without tracing several levels of parentheses.

=IFS(logical_test1,value_if_true1,logical_test2,value_if_true2,...)

Use the same score categories from the nested IF example. In C2, enter the following formula, then copy it down the result column.

=IFS(B2>=90,"Excellent",B2>=75,"Good",B2>=50,"Pass",TRUE,"Fail")

The final TRUE is a catch-all condition. If no earlier condition matches, it ensures that Excel returns Fail. Without a matching condition, IFS normally returns the #N/A error. Consequently, a fallback is particularly useful when your rules cover a broad range of possible inputs.

Why IFS condition order matters

Imagine that cell B3 contains 78 and C3 contains the copied formula. The first condition, B3>=90, is false. The second condition, B3>=75, is true and returns Good. Although 78 also satisfies the lower threshold, that later result is not selected because IFS returns the first matching result.

This distinction is important: the first-match rule describes the returned value, not a guarantee that Excel never evaluates any later argument. Avoid relying on IFS as a mechanism for suppressing errors in other expressions.

For example, try the wrong order with B2>=50 first. A score of 95 would receive Pass rather than Excellent. To fix the formula, restore the descending order of 90, 75 and 50, followed by the unconditional fallback.

IFS is available in Microsoft 365 and Excel 2019 or later perpetual releases. If a colleague uses Excel 2016 perpetual, provide the equivalent nested IF formula. In addition, use the workbook’s dedicated IFS and Nested IF sheets to compare both approaches on the same input values.

Excel IFS function returning Good for a score of 78 using ordered conditions

IF vs IFS in Excel

IF is usually the simplest option for a binary decision, such as whether a budget is exceeded or a task is complete. IFS is more convenient when several ordered categories are required. Nevertheless, either approach can express the four score bands in our example.

Choose IF when the result depends on one condition with two outcomes, or when compatibility with older spreadsheet software is important. Choose IFS when a sequence of overlapping rules needs to be clearly visible. In both cases, make sure the return values are consistent with the intended data type.

For long classification lists that change regularly, consider storing thresholds and labels in a separate table instead. A lookup function can reduce repeated hard-coded values and make the policy easier to update. Our XLOOKUP guide explains another useful approach to retrieving values from structured datasets.

Ultimately, readability is more important than choosing the newest function. A colleague should be able to identify the condition, understand the possible outcomes and check boundary cases without reverse-engineering a complex formula.

Side-by-side comparison of Excel IF and IFS functions

Combining IF with AND and OR

Sometimes one logical test is not enough. AND returns TRUE when all its conditions are true, whereas OR returns TRUE when at least one condition is true. Therefore, combining these functions with IF lets you express decisions that depend on multiple inputs.

Use IF with AND for mandatory conditions

Suppose B2 contains technical approval and C2 contains business approval. A project item should be marked Ready only when both approvals are present. Otherwise, the item remains Pending.

=IF(AND(B2="Approved",C2="Approved"),"Ready","Pending")

For example, technical approval alone is insufficient. The formula returns Ready only when both cells contain Approved. This pattern works well for quality gates, acceptance criteria and operational readiness checks.

Use IF with OR for alternative triggers

Now suppose D2 contains issue priority and E2 contains issue status. An issue must be escalated if its priority is Critical or its status is Blocked. Either condition is sufficient to trigger the escalation.

=IF(OR(D2="Critical",E2="Blocked"),"Escalate","Monitor")

A medium-priority blocked issue returns Escalate, just as a critical open issue does. However, an open issue with medium priority returns Monitor. Test all combinations of inputs before applying the rule to an operational report.

To reduce spelling variations in status fields, consider creating controlled choices with Excel drop-down lists. In addition, you can use conditional formatting to highlight escalation results without changing the underlying formula.

Using IF and IFS in Excel for Project Management

Project managers often collect data from multiple sources and need to convert it into clear status indicators. IF and IFS in Excel can help standardize that process. However, the resulting labels should support discussion and judgment rather than replace them.

Budget monitoring

Assume column B contains the approved budget and column C contains actual expenditure. In D2, compare the actual cost with the budget. If expenditure exceeds the approved amount, return Over budget; otherwise, return Within budget.

=IF(C2>B2,"Over budget","Within budget")

For a budget of 15,000 and actual expenditure of 16,500, the result is Over budget. By contrast, actual expenditure equal to the approved budget returns Within budget. Make sure both inputs use the same currency and reporting period.

Schedule monitoring

Suppose B2 contains the planned finish date, C2 contains the task status and F1 contains the reporting date. Check the completion status first, because an already completed task should not be flagged as an open overdue task.

=IF(C2="Completed","Completed",IF(B2<$F$1,"Overdue","On track"))

An unfinished task with a planned finish before the reporting date returns Overdue. Meanwhile, an unfinished task due on the reporting date returns On track under this example rule. Adjust the comparison if your organization defines overdue differently. Use genuine Excel date values and validate missing due dates before reporting.

Risk classification

Assume B2 contains probability and C2 contains impact, each scored from 1 to 5. Calculate the risk score in D2 by multiplying these values. Next, classify the result in E2 according to the agreed thresholds.

=B2*C2
=IFS(D2>=15,"High",D2>=6,"Medium",TRUE,"Low")

A score of 15 returns High, a score of 6 returns Medium and a score of 5 returns Low. These thresholds are illustrative, not universal risk management standards. Therefore, adapt them to your organization’s approved risk matrix.

Once the classification columns are reliable, summarize the results in an Excel dashboard. For example, show counts of overdue tasks, over-budget items and high risks. This gives stakeholders a quick overview while keeping the original records available for review.

Excel IF and IFS formulas for project budget, schedule and risk reporting

Common Errors When Using IF and IFS in Excel

Check the formula syntax and cell references

A missing quotation mark, comma or closing parenthesis can prevent Excel from accepting a formula. First, check that every opening parenthesis has a matching closing parenthesis. Then verify that your text results use straight double quotation marks.

If Excel reports a circular reference, check whether the output formula refers to its own cell. For instance, C2 should reference the score in B2, not itself. Likewise, when copying formulas, ensure that fixed thresholds use absolute references.

Investigate unexpected results

Incorrect classifications often come from overlapping conditions in the wrong order. For example, checking the lowest passing threshold first can prevent a higher score from receiving its intended classification. Test the exact threshold, one value below it and one value above it.

An #N/A result in IFS can mean that none of its conditions matched. Add an appropriate fallback condition when the classification requires one. However, do not hide an invalid or missing input by automatically labeling it as a valid category.

A #NAME? error may indicate an unsupported function or a spelling mistake. Check your Excel version if IFS is unavailable. Also, remember that local settings can change function names and list separators.

Numbers imported as text can cause unexpected comparisons. Use Excel’s error indicators or suitable conversion tools to normalize those values. Similarly, remove stray spaces from imported status labels before checking them against text constants.

Build a repeatable testing routine

Before sharing a workbook, test ordinary values, exact boundaries, blank cells and unusual inputs. In addition, compare several results manually against the written business rules. A formula that works for a single example is not necessarily correct for every record.

Download the Free Excel Practice Workbook

The companion workbook contains ten worksheets covering logical tests, basic IF, nested IF, IFS, AND and OR, business examples and project management. It also includes twenty independent exercises and a solutions sheet so you can check your progress.

Start with the Start Here sheet and work through the examples in order. Next, change the editable input cells to observe how the formulas respond. Finally, enter your own formulas in the yellow exercise cells and compare the feedback with the worked solutions.

The workbook uses fictional records and does not require macros. Moreover, it includes equivalent nested IF examples for learners using older versions of Excel. The download is free and does not require registration.

Practice conditional formulas with 10 worksheets, 20 exercises and complete solutions.

Frequently Asked Questions About IF and IFS in Excel

What is the difference between IF and IFS in Excel?

IF returns one of two results based on a logical test. IFS accepts multiple condition-and-result pairs and returns the result corresponding to the first true condition. Both can be used to classify data.

Can I use IF with more than two outcomes?

Yes. You can nest additional IF functions inside the true or false arguments. However, IFS is often easier to read when several ordered conditions determine the result.

How do I set a default result in IFS?

Add TRUE as the final logical test, followed by the desired fallback value. For example, TRUE,”Fail” returns Fail when none of the earlier score conditions matches. Make sure that fallback is appropriate for the input data.

Can IF return a number instead of text?

Yes. IF can return numbers, calculations, text, cell references or other formula results. For example, a commission calculation can return a monetary amount when a target is achieved and zero otherwise.

Why does my IFS formula return the wrong category?

First, check the order of your conditions. When several conditions match, IFS selects the first matching result. Next, verify the comparison operators and whether your input is stored as a numeric value.

Does IF work with dates and text?

Yes. Excel can compare genuine date values, numbers and text. For example, you can compare a planned finish date with a reporting date or check whether a status cell contains Completed.

Can I use IF and IFS with conditional formatting?

Yes. You can use the results of conditional formulas as the basis for formatting rules. Alternatively, create formatting rules that directly test the underlying values. Keep the decision logic consistent between both approaches.

Conclusion

IF and IFS in Excel help turn spreadsheet data into consistent, understandable decisions. Start with a simple IF formula, then learn how to combine tests with AND and OR. Once you are comfortable with two outcomes, use nested IF or IFS to classify records into multiple categories.

Above all, write the business rule before writing the formula. Test exact boundaries, handle missing values deliberately and document assumptions. As a result, your spreadsheets will be easier to maintain and more useful to the people who rely on them.

Download the practice workbook, complete the exercises and apply the techniques to a small dataset of your own. Then continue building your skills with the related Excel guides below.

Explore the complete Excel learning hub.

Get Practical Insights from TechTeamSynergy

Join TechTeamSynergy Weekly for practical insights, frameworks, templates and resources covering Technology, Team and Transformation.

Join TechTeamSynergy Weekly →