Cellgrids Cellgrids
Home › Practice questions › IFERROR › Question 9

Excel IFERROR Practice Question: Product IDs to price are in A2:A7 and the price list is in D2:E6. Show the…

By Rinkesh Shah, founder of Cellgrids.

The question

Product IDs to price are in A2:A7 and the price list is in D2:E6. Show the price in G2:G7, or the text Not found when the ID is not in the list.

The data

ABCDEFG
1Product IDProduct IDUnit pricePrice
2P-102P-101450?
3P-109P-1021250?
4P-105P-103299?
5P-107P-104780?
6P-101P-1052150?
7P-104?

The yellow cells are where your answer goes.

Show answer

Expected results:

  • G2 = 1250
  • G3 = Not found
  • G4 = 2150
  • G5 = Not found
  • G6 = 450
  • G7 = 780

How it works

Explanation: IFERROR returns your own message when the formula inside gives an error. A missing ID makes VLOOKUP return #N/A, which IFERROR replaces.
Syntax: =IFERROR(VLOOKUP(A2,$D$2:$E$6,2,FALSE),"Not found")
P-109 and P-107 are not in the list, so they show Not found.

Try it yourself in the live sheet

Type your formula in the highlighted cell and get instant feedback. Free, no Excel install needed.

Try this question in the live sheet →

IFERROR syntax

=IFERROR(value, value_if_error)

Runs a formula, but shows a fallback value instead of an error if it fails. IFERROR is used to build decision rules directly into a spreadsheet instead of manually judging each row. Full IFERROR guide.

More IFERROR practice questions

All practice questions · Excel exercises · Interview prep · Cheat sheet