Prices with XLOOKUP
Pull unit prices from a product list by code, fix the list with $ signs and handle codes that are not listed.
20% complete
Step 2 of 5Practise this in Sim Bay
Training
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])| Row | E: Code | F: Product | G: Price (KES) |
|---|---|---|---|
| 2 | SS-210 | School shoe | 2499 |
| 3 | SN-450 | Canvas sneaker | 1999 |
| 4 | SD-120 | Ladies sandal | 899 |
| 5 | BT-330 | Ankle boot | 4599 |
| 6 | SL-075 | Slipper | 499 |
=XLOOKUP("SN-450",$E$2:$E$6,$G$2:$G$6,"Not listed")- Exact match only: XLOOKUP returns the first row whose code matches. Upper and lower case do not matter, so sd-120 finds SD-120.
- A number never matches text that looks like a number: 1050 and "1050" are different codes.
- When nothing matches, XLOOKUP shows #N/A. The optional fourth argument replaces it, for example "Not listed".
- This simulator supports exact match only: the extra match_mode and search_mode arguments give #VALUE!. For tier tables, see the nested IF exercise.