Formula explainer

IFERROR with VLOOKUP explained

New
ResultCalculating…

IFERROR evaluates VLOOKUP first and uses its fallback only when that lookup fails. Here P-999 is missing, so #N/A is caught and replaced with Not found.

Inside the formula

  • ↗
    • ↗

Example data

How this IFERROR formula works

The inner VLOOKUP returns #N/A. IFERROR marks that error as caught, selects the fallback, and returns Not found instead.

The top row above is the whole formula. Open any argument that holds a calculation of its own to see the values it used. Excel works out those inner parts first, because the function around them needs their results. Edit a cell in the grid to see every value update.

Try your own formula and data

The sample spreadsheet is fully editable. Change the formula or any cell it references. The intermediate values recalculate in your browser.

Practice with an exercise

Here is an exercise that uses IFERROR. Type the formula into a real spreadsheet and we will check your answer as you go.

Nested IFERROR for multi-table fallback

Intermediate

Search across three inventory lists and return "Not found" only when a code is missing everywhere.

Open exercise

Common mistakes with IFERROR

If this formula is not doing what you expect, one of these is usually why.

Why does IFERROR always show Not found?

The wrapped lookup is failing every time. Test VLOOKUP on its own to expose the original error, then check the lookup value, range, and column number.

Does IFERROR only catch #N/A?

No. IFERROR catches any Excel error, including #REF!, #VALUE!, and #DIV/0!. Use IFNA when only a missing lookup should trigger the fallback.

Can IFERROR hide a broken formula?

Yes. A bad range or invalid column number can look like an ordinary Not found result. Debug the inner formula before wrapping it.

How can I test the success path?

Change A2 to an ID present in D2:D7, such as P-104. VLOOKUP will return 32 and IFERROR will pass it through without using the fallback.