XLOOKUP practice exercises (with answers)
Eight XLOOKUP drills covering fill-down, lookup-to-the-left, if_not_found, and approximate bands—plus links into interactive lessons.
XLOOKUP is the modern default for vertical lookups in Microsoft 365 and Excel 2021+. These problems use one catalog table. When you want instant checking, open the XLOOKUP function guide or XLOOKUP practice.
The practice table
Put this catalog in G1:J8 (headers in row 1):
G1:J1— SKU, Product, Price, StockPL-101, Fern,9.5,40PL-104, Monstera,34,12PL-107, Snake plant,22,25PT-210, Terracotta pot,12.5,60PT-212, Ceramic pot,19,18TL-301, Watering can,18,9SL-401, Potting mix,7.25,80
And this order sheet in A1:D5:
A1:D1— Order, SKU, Qty, Product2001,PL-104,2, (blank)2002,PT-210,1, (blank)2003,TL-301,3, (blank)2004,PL-101,1, (blank)
Syntax that matters
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
Exact match is the default. Keep lookup_array and return_array the same height and starting on the same row—offset ranges return a neighbor’s value with no error.
Exercise 1 — fill product names
In D2, return Product for the SKU in B2, then fill down to D5.
Answer: =XLOOKUP(B2, $G$2:$G$8, $H$2:$H$8)
Lock both arrays with $ before filling. Expected products: Monstera, Terracotta pot, Watering can, Fern.
Exercise 2 — look left (SKU from name)
In M1 type Fern. In M2, return its SKU by searching the Product column.
Answer: =XLOOKUP(M1, $H$2:$H$8, $G$2:$G$8) → PL-101
VLOOKUP cannot do this without rearranging columns. This is the clearest everyday reason to prefer XLOOKUP.
Exercise 3 — price into the order
Add a Price column in E. In E2, return price for B2 and fill down.
Answer: =XLOOKUP(B2, $G$2:$G$8, $I$2:$I$8)
Exercise 4 — missing key with a message
Change order 2004’s SKU to PL-999. Update the Product formula so missing SKUs show Not found instead of #N/A.
Answer: =XLOOKUP(B2, $G$2:$G$8, $H$2:$H$8, "Not found")
Prefer the fourth argument over wrapping the whole formula in IFERROR, which also hides real mistakes.
Exercise 5 — row alignment bug
Someone writes =XLOOKUP(B2, $G$2:$G$8, $H$3:$H$9). Why is that dangerous?
Answer: the return array starts one row lower. XLOOKUP pairs positions, not “the Product column,” so you can get the next product’s name with no #N/A. Always start both ranges on the same row.
Exercise 6 — stock check
In F2, return Stock for each order SKU. Flag low stock by wrapping with IF so anything under 15 shows Reorder instead of the number.
One approach: =IF(XLOOKUP(B2,$G$2:$G$8,$J$2:$J$8)<15, "Reorder", XLOOKUP(B2,$G$2:$G$8,$J$2:$J$8))
Better for readability: put the XLOOKUP in a helper column, then IF on that helper.
Exercise 7 — approximate delivery fee
Fee slabs in A12:B15 (lower limit, fee):
0→3099→15200→5500→0
In C12, return the fee for an order amount of 140 using match mode -1 (exact or next smaller).
Answer: =XLOOKUP(140, $A$12:$A$15, $B$12:$B$15, , -1) → 15
The blank fourth argument keeps the default “not found” behavior; -1 is the fifth argument.
Exercise 8 — interview talking points
Be ready to say, in one breath:
- XLOOKUP defaults to exact match; VLOOKUP defaults to approximate if you omit
FALSE. - Separate lookup and return arrays mean you can look left and survive inserted columns.
if_not_foundbeats blanketIFERRORfor missing keys.- On Excel 2019 or earlier, fall back to INDEX/MATCH (and MATCH).
Drill it for real
- Guide: XLOOKUP function
- Lessons: XLOOKUP practice, XLOOKUP practice 2, XLOOKUP wildcards
- Still supporting legacy files? Keep VLOOKUP practice exercises in your rotation, then compare both in VLOOKUP vs XLOOKUP.
- Choosing between XLOOKUP and INDEX/MATCH? Read XLOOKUP vs INDEX MATCH, then drill INDEX MATCH practice.