IFERROR in Excel replaces an error result with a value you choose, so your spreadsheet shows a clean number, blank, or message instead of #DIV/0!, #N/A, #VALUE!, #REF!, #NAME?, or #NUM!. The syntax is =IFERROR(value, value_if_error): Excel returns value when it calculates normally, and value_if_error when it produces any error. You only need Excel itself—no add-ins or special settings. Menu and ribbon labels can differ slightly by Excel version, platform, or region.

What You'll Need

  • Excel for Microsoft 365, Excel 2021, 2019, 2016, or Excel for the web. IFERROR is not available in Excel 2007 or earlier.
  • A worksheet with a formula that can return an error (for example, a division or lookup).
  • Basic familiarity with entering formulas and copying them down a column.

Step-by-Step

  1. Find the formula that errors. Select the cell showing an error and look at the formula bar. For example, =A2/B2 returns #DIV/0! when B2 is zero or blank.
  2. Decide what should appear instead. Common choices are "" (blank), 0, "Not available", or a dash "-". Choose a value that will not be mistaken for real data.
  3. Wrap the original formula. Type =IFERROR(, paste or type the original formula without its equals sign, then a comma, then your fallback, then a closing parenthesis. Example: =IFERROR(A2/B2, "").
  4. Press Enter. The cell now shows the normal result when the calculation works, and your fallback when it errors.
  5. Copy the formula down. Drag the fill handle (the small square at the bottom-right of the cell) down the column, or copy the cell and paste it into the range below. Relative references adjust automatically.
  6. Check a few rows. Confirm that rows with valid data still show the correct number and only the problem rows show the fallback.
  7. Test the error path deliberately. Temporarily clear a divisor or change a lookup value to something missing, confirm the fallback appears, then restore the original data.

Common Mistakes

  • Leaving out the comma and fallback. =IFERROR(A2/B2) is invalid; you must supply both arguments.
  • Using an empty fallback where a number is expected. "" is text, so SUM and AVERAGE may ignore it or behave differently than with 0. Use 0 if downstream math needs a number.
  • Hiding real problems. IFERROR also hides #REF! and #NAME? errors caused by broken references or misspelled function names. Fix those instead of masking them.
  • Wrapping the whole workbook. Applying IFERROR everywhere makes it hard to spot data issues. Use it where errors are expected, such as lookups and divisions.
  • Forgetting quote marks around text. Not available without quotes returns a #NAME? error; write "Not available".

Tips

  • Use IFNA instead when you only want to catch #N/A from lookups (VLOOKUP, XLOOKUP, INDEX/MATCH) and let other errors show.
  • For lookups, combine with XLOOKUP's built-in if_not_found argument if your version supports it, which avoids a wrapper formula.
  • Keep the fallback consistent down a column so sorting and filtering behave predictably.
  • If you need to distinguish error types, use ISERROR or ERROR.TYPE inside an IF formula.
  • Use Excel's Evaluate Formula tool (Formulas tab > Evaluate Formula) to see exactly where an error originates before wrapping it.

Troubleshooting

  • Formula returns #NAME? after wrapping. A text fallback is missing quotes, or the function name is misspelled. Check for " around text values.
  • Fallback appears in every row. The original formula is erroring everywhere—often a wrong range, a text value in a numeric cell, or a lookup table that does not match. Fix the source, not the wrapper.
  • Excel says the formula is not valid. Check parentheses: one after the original formula's arguments and one at the very end. Commas separate arguments; some regional settings use semicolons instead of commas.
  • Numbers show as text after copying. A fallback of "" can make a column mixed-type. Replace with 0 or use a helper column to coerce values with VALUE().
  • IFERROR is not recognized. You are likely in Excel 2007 or earlier. Use =IF(ISERROR(formula), fallback, formula) as the older equivalent.

Frequently Asked Questions

What does IFERROR do in Excel?

It returns a value you specify when a formula produces any error, and the normal result otherwise. It is a cleaner alternative to IF(ISERROR(...)).

What is the difference between IFERROR and IFNA?

IFERROR catches every error type. IFNA catches only #N/A, which is useful for lookups where you want other errors to remain visible.

Can IFERROR return a blank cell?

Yes. Use "" as the second argument, for example =IFERROR(A2/B2, ""). The cell looks blank but still contains a formula.

Does IFERROR work in Excel for the web and Excel for Mac?

Yes, IFERROR is supported in modern Excel for Windows, Mac, and the web. It is not available in Excel 2007 or earlier.

Why does IFERROR hide errors I want to see?

Because it catches all error types. If you need to see #REF! or #NAME? errors, use IFNA for lookups or fix the underlying formula instead of wrapping it.

Can I use IFERROR with VLOOKUP?

Yes. Wrap the lookup: =IFERROR(VLOOKUP(A2, Sheet2!A:B, 2, FALSE), "Not found"). This replaces #N/A when no match exists.