Use Excel’s SWITCH function to replace nested IFs

Replace long, nested IF formulas with a clearer SWITCH expression that maps input values to results in a single, readable formula.

What the video covers

Show how to build a basic SWITCH formula that evaluates one value and returns a matching result.

Watch the video on YouTube

Step-by-step instructions

  1. Select a cell
    Click an empty cell where you want the SWITCH result to appear.
  2. Start the formula
    Type =SWITCH( to begin the function.
  3. Provide the value to evaluate
    Select the cell (or type the expression) whose value you want SWITCH to evaluate, then type a comma.
  4. Enter value→result pairs
    Type the first value to match, type a comma, then type the result to return for that match, and type a comma. Repeat value, comma, result pairs for additional options.
  5. Close the formula and confirm
    Add the closing parenthesis ), press Enter, and verify Excel returns the matching result.

Watch the video

Video thumbnail for Use Excel’s SWITCH function to replace nested IFs Play tutorial

Watch on YouTube

Why it matters

Nested IFs become hard to read and maintain. SWITCH lets you list value→result pairs in one place, making formulas cleaner and easier to edit.

Check your result

After entering the formula, Excel should return the result that corresponds to the evaluated value. Change the evaluated cell to confirm different matches return the expected results.

Troubleshooting

If the formula returns an unexpected result or an error, check that commas and the closing parenthesis are present, that the evaluated value matches the type you compared (text vs number), and that text values are enclosed in quotes. If matches aren’t found, verify the value list you provided.