IFERROR
Catch formula errors and show a friendly value instead.
IFERROR wraps a formula and replaces any error (#N/A, #DIV/0!, #REF!) with a value you choose.
Excel
=IFERROR(VLOOKUP(D2, A:B, 2, FALSE), "Not found")Google Sheets
=IFERROR(VLOOKUP(D2, A:B, 2, FALSE), "Not found")How it works
- 1The VLOOKUP runs first.
- 2If it errors, "Not found" is shown instead of the error code.