Excel beginner vlookup iferror error-handling formulas

How to Return Friendly Messages on VLOOKUP Errors?

Handle VLOOKUP Errors Gracefully is a Excel function that performs a vlookup and returns a specified message if an error occurs.. Formula Genius generates and validates this formula automatically from a plain-English prompt.

VLOOKUP can often lead to errors when no match is found. Using IFERROR allows you to display a user-friendly message instead.

The Formula

Prompt

"Return a friendly message instead of an error when a VLOOKUP fails to find a match"

Excel
=IFERROR(VLOOKUP(A1, B1:C10, 2, FALSE), "Not Found")

This formula performs a VLOOKUP and returns a specified message if an error occurs.

Step-by-Step Breakdown

  1. VLOOKUP searches for a value in the first column of a range.
  2. If a match is found, it returns the corresponding value from a specified column.
  3. IFERROR checks if the VLOOKUP results in an error.
  4. If there is an error, it returns the friendly message instead.
  5. If there is no error, it returns the result of the VLOOKUP.

Edge Cases & Warnings

  • The lookup value is not present in the lookup range.
  • The lookup range is incorrectly defined, leading to an error.
  • The column index number is greater than the number of columns in the range.
  • The lookup value is of a different data type than the values in the first column.

Examples

Prompt

"A1 = 'Apple', B1:C10 contains 'Banana' and 'Orange'"

Excel
Not Found
Prompt

"A1 = 'Banana', B1:C10 contains 'Banana' with corresponding value 'Yellow'"

Excel
Yellow

Frequently Asked Questions

What does IFERROR do?

IFERROR captures errors in a formula and allows you to specify an alternative result.

Can I use IFERROR with other functions?

Yes, IFERROR can be used with any function that may return an error.

What happens if VLOOKUP finds a match?

If VLOOKUP finds a match, it will return the corresponding value instead of the error message.

Can't find what you need?

Describe any formula in plain English and Formula Genius will generate, explain, and validate it — instantly.