Module 16 · Job Tests
The price list task

Jamal passed the screening. The second round is a price list task. Customers order by code, and the workbook must show the product and the price of each order. Some phone orders have old or wrong codes. Jamal sets his egg timer to 8 minutes.
Steps
One XLOOKUP for the whole column
Write XLOOKUP once and copy it down. Lock the price list with $ signs, so that the copy does not move it.
How to do it
- Select the first cell of the column.
- Type =XLOOKUP( and the cell with the code.
- Type the codes of the price list with $ signs and a comma.
- Type the column to return with $ signs and a closing bracket.
- Press Enter.
- Select the formula and the cells below it.
- Press Ctrl+D.
- Without $, the copy in row 6 searches H6:H12, the copy in row 7 searches H7:H13, and so on. Codes at the top of the list are then missing.
=XLOOKUP(B5,$H$5:$H$11,$I$5:$I$11)Task: Fill the unit prices in E5:E12. The prices are in column J of the price list.
Codes that are not in the list
XLOOKUP shows #N/A when a code is not in the list. IFERROR shows your own text instead. IF then decides what to do.
How to do it
- Select the first cell of the column.
- Type =IFERROR(
- Type the XLOOKUP and a comma.
- Type the text for an error in quotation marks and a closing bracket.
- Press Enter.
- Select the formula and the cells below it.
- Press Ctrl+D.
- XLOOKUP has its own value for this: =XLOOKUP(B16,$H$5:$H$11,$I$5:$I$11,"Check code"). Both ways give the same result.
=IFERROR(XLOOKUP(B16,$H$5:$H$11,$I$5:$I$11),"Check code")Task: Fill the Action column in E16:E19. When the product shows Check code, write Call customer. Otherwise write Ship. Use IF.