How to Use the IF Function in Excel in 2026

How to use IF function in Excel to return one value for a true condition and another value for a false condition.

T

Technobezz

Senior Editor

Jul 15, 2026
6 min read

Contents

Don't Miss the Good Stuff

Get tech news that matters delivered weekly. Join 50,000+ readers.

You need Excel to make a decision in a worksheet: mark a budget line, label a result, or return different text when a value changes. The IF function handles that by testing one condition and returning one result when the test is true and another when it is false. Start with the plain formula, then use Excel's built-in helpers when you want the dialog, web, table, multi-condition, or Copilot route.

1. Type the basic IF formula first

The standard pattern is =IF(logical_test, value_if_true, [value_if_false]): the first argument is the test, the second is the result for true, and the third is the result for false.

  1. 1.Select the cell where you want the answer to appear.
  2. 2.Type =IF(.
  3. 3.Enter the logical_test, such as A2>B2.
  4. 4.Enter the value_if_true, such as "Over Budget".
  5. 5.Enter the value_if_false, such as "OK".
  6. 6.Close the formula with ).
  7. 7.Press Enter on Windows or Return on Mac.

For a budget check, use =IF(A2>B2,"Over Budget","OK"). If A2 is greater than B2, Excel returns Over Budget. If the test is false, Excel returns OK.

2. Let AutoComplete insert IF

Formula AutoComplete helps you pick the function while you type, which is useful when you know the formula you want but do not want to type every function name by hand.

In Excel for Windows:

  1. 1.Select a cell.
  2. 2.Type =, then type IF.
  3. 3.Choose IF from the dynamic drop-down list.
  4. 4.Press Tab or double-click IF.
  5. 5.Finish the arguments, close the formula with ), and press Enter.

To manage that list on Windows, open File > Options > Formulas > Working with formulas > Formula AutoComplete. While editing a formula, press Alt + Down Arrow to toggle the list.

On Mac, open Excel > Preferences > Formulas and Lists > AutoComplete, then select Show AutoComplete options for functions and named ranges. When the menu appears, use Up Arrow or Down Arrow, then press Tab to insert IF.

3. Build IF with Insert Function

  1. 1.Select the cell where the result should appear.
  2. 2.Select Insert Function on the formula bar.
  3. 3.Under Or select a category, choose All.
  4. 4.Select IF.
  5. 5.Fill Logical_test, Value_if_true, and Value_if_false in the Function Arguments dialog.
  6. 6.Select OK.

Use Excel's Insert Function flow when you prefer boxes for each argument instead of typing the whole formula from memory.

Keyboard users can select a cell, press Shift + F3, choose IF, fill the argument boxes, and select OK.

4. Use IF in Excel for the web

The direct formula route works in the browser, and the available-functions shortcut is there when you want help building it.

  1. 1.Select a cell.
  2. 2.Type =IF(.
  3. 3.Use the argument tooltip and Formula AutoComplete while you enter the test, true result, and false result.
  4. 4.Close the formula with ).
  5. 5.Press Enter.

You can also select a cell, press Shift + F3, choose from the available functions, and finish the IF formula with the Insert Function help shown in Excel for the web.

5. Fill a table column with one IF formula

  1. 1.Create an Excel table.
  2. 2.Insert a new table column.
  3. 3.Select one cell in that new column.
  4. 4.Type the IF formula.
  5. 5.Press Enter.

When your data is already in an Excel table, one IF formula can populate a calculated column. Excel automatically fills the formula into the rest of the column.

Use this when each row needs the same test, such as comparing actual spending with budget spending across the table.

6. Check multiple conditions with IF

Put AND, OR, or NOT inside the first IF argument when more than one requirement is involved: AND requires every condition to be true, OR allows one condition to be true, and NOT reverses the condition.

  1. 1.Select the cell for the result.
  2. 2.Type a formula such as =IF(AND(condition1,condition2), value_if_true, value_if_false).
  3. 3.Use OR or NOT in the same first-argument position when that matches the test you need.
  4. 4.Press Enter or Return.

The rule stays the same: the logical test goes first, the true result goes second, and the false result goes third.

7. Switch to IFS for several results

  1. 1.Select the cell for the result.
  2. 2.Type =IFS(.
  3. 3.Enter logical_test1, then value_if_true1.
  4. 4.Add the next logical_test and its paired value_if_true.
  5. 5.Close the formula with ).
  6. 6.Press Enter or Return.

Nested IF formulas place another IF inside Value_if_true or Value_if_false. Microsoft documents nesting up to 64 functions, but the cleaner current option for several condition-result pairs is often IFS when your Excel version supports it.

The pattern is =IFS(logical_test1, value_if_true1, logical_test2, value_if_true2, ...). Use it when each true condition should return its paired result.

8. Ask Copilot for an IF formula

Copilot can generate or explain an IF formula when Excel, your subscription, your license, and your organization settings include it.

  1. 1.Select the Copilot icon in the lower-right corner of Excel.
  2. 2.Ask for the formula you need, such as Create an IF formula that returns Over Budget if C2 is greater than B2, otherwise Within Budget.
  3. 3.Review, edit, and verify the formula before using it.

Excel can also show Copilot formula suggestions when you type = in a cell or enter example values that follow a pattern. On Windows, manage those suggestions through File > Options > Copilot. In Excel for the web, use File > Options > Copilot Settings. In the web suggestion card, use More options > Turn off Copilot suggestions for completing formulas when you want to disable that suggestion type.

9. Avoid old Ctrl Shift Enter advice

Older Excel instructions may mention Ctrl + Shift + Enter for array formulas. That is legacy array-formula guidance, not the current Microsoft 365 dynamic-array flow.

In current Microsoft 365 Excel, enter the formula in the top-left cell and press Enter. Dynamic arrays spill automatically, so do not use the old shortcut as your default IF formula step.

Frequently Asked Questions

Can I use IF on Excel for Mac?

Yes. Microsoft lists the IF function for Excel for Microsoft 365 for Mac, Excel 2024 for Mac, and Excel 2021 for Mac. Type the formula directly or use Mac AutoComplete from Excel > Preferences > Formulas and Lists > AutoComplete.

How do I open Insert Function without the mouse?

Select a cell and press Shift+F3. On Windows and Excel for the web, that opens the Insert Function dialog; on Mac it opens the Formula Builder. Either way, choose IF and fill the argument boxes.

Does Formula AutoComplete work the same in Excel for the web?

Excel for the web supports formula entry help and Formula AutoComplete, but Microsoft notes that the Windows Formula AutoComplete toggle under File > Options > Formulas does not apply to Excel for the web.

Can Copilot replace checking my IF formula?

No. Use Copilot to generate or explain a formula when it is available, then review, edit, and verify the result before using it.

Share