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):

And this order sheet in A1:D5:

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):

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:

  1. XLOOKUP defaults to exact match; VLOOKUP defaults to approximate if you omit FALSE.
  2. Separate lookup and return arrays mean you can look left and survive inserted columns.
  3. if_not_found beats blanket IFERROR for missing keys.
  4. On Excel 2019 or earlier, fall back to INDEX/MATCH (and MATCH).

Drill it for real

Excel practice hub · Free lessons · Blog