SheetCommand · Excel formulas

How to use IFERROR in Excel

Show a readable result when a formula fails without losing sight of the cause.

IFERROR returns your chosen fallback when a formula produces an error. It is useful when a VLOOKUP key is missing or a division has a zero denominator, but it does not repair the underlying data.

What does IFERROR catch?

The syntax is IFERROR(value, value_if_error). If the first expression succeeds, its original value is returned; otherwise Excel uses the fallback.

The function catches several error types, including #N/A and #DIV/0!. Treating them all alike can hide an incorrect formula or a bad source value.

Make a VLOOKUP result readable

The example looks up the code in A2 within F:H. It shows Not found when the lookup fails and returns the matching value otherwise.

Test a known key and a missing key before filling down. Check that the lookup range and return-column index are correct; a fallback message should not conceal a broken formula.

How to do it

  1. Test the lookup formula on its own.
  2. Wrap it in IFERROR and add a clear fallback.
  3. Check both matching and missing test records.
Example formula=IFERROR(VLOOKUP(A2,$F$2:$H$100,3,FALSE),"Not found")

Avoid hiding important errors

IFERROR catches every supported error type. If you only want to handle a missing lookup result, consider IFNA where available.

Returning a blank for a division error may make incomplete data look valid. For audited reports, inspect zero and missing inputs separately. Your Excel region may use semicolons instead of commas.

Frequently asked questions

Does IFERROR fix a formula?

No. It replaces the displayed error result; the underlying formula or input issue remains.

Can SheetCommand insert IFERROR?

No. This is an Excel tutorial. SheetCommand currently supports the listed data cleanup, sorting, summary, and basic calculation commands.

Sources and further reading

SheetCommand

Check the source table first

Inspect blank and duplicate rows before adding the formula in Excel.

Use for free →