Module 7 · Lookup
Parts we do not stock

Customers order parts that Kestrel does not stock. The lookup shows #N/A, and the total breaks. Kofi wants a clear answer for each order and a total that works.
Steps
Show a text if XLOOKUP finds nothing
XLOOKUP has a fourth value: if_not_found. XLOOKUP gives it back when it does not find the value.
How to do it
- Select the cell for the result.
- Type XLOOKUP with the value to find, the lookup column and the return column. Type a comma.
- Type the text for if_not_found and a closing bracket.
- Press Enter.
=XLOOKUP(C5,H:H,I:I,"Not stocked")Task: Find the part names for the other orders. Fill in D6:D12.
Catch #N/A from VLOOKUP with IFERROR
VLOOKUP has no if_not_found value. Put it inside IFERROR to give back a different value.
How to do it
- Click cell E5.
- Type IFERROR and the VLOOKUP inside it. Type a comma.
- Type the value for an error and a closing bracket.
- Press Enter.
- XLOOKUP can do the same with a number: =XLOOKUP(C5,H:H,J:J,0).
=IFERROR(VLOOKUP(C5,H:J,3,FALSE),0)Task: Find the prices for the other orders. Fill in E6:E12.