Prices with XLOOKUP
Pull unit prices from a product list by code, fix the list with $ signs and handle codes that are not listed.
40% complete
Simulation score: not scored yet
Simulation
In C2:C5, look up each order line's unit price (KES) from the price list in E1:G6 with XLOOKUP. Fix the price list with $ signs so the formula can be reused on every row. If a code is not on the price list, show the text "Not listed" instead of #N/A.
Swipe the sheet sideways to see columns A–G.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | |||||||
| 2 | |||||||
| 3 | |||||||
| 4 | |||||||
| 5 | |||||||
| 6 |
Outlined cells are editable; shaded cells are locked. Use the arrow keys to move, Enter or F2 to edit, Escape to cancel. Formulas start with =: while typing one, click or drag cells (or use the arrow keys) to add them, and a missing closing bracket is added when you press Enter. Drag the small square at the corner of the selected cell to fill (double-click it to fill down; Alt+arrow also fills). Available functions: XLOOKUP.
Hints
- XLOOKUP has three parts plus an optional fourth: =XLOOKUP(what to find, where to look, what to return, [if not found]).
- Look for the code in B2 inside the Code column of the price list, and return the matching cell from the Price column.
- Add $ signs to the price list ranges (for example $E$2:$E$6) so they stay fixed on every row, while B2 becomes B3, B4 and B5.
- Text matching ignores upper and lower case, so "sd-120" finds "SD-120". The fourth argument, in double quotes, replaces #N/A.