About this lesson

D7 LESSON 27 · PASS

XLOOKUP: lookups with if-not-found and search from the bottom

XLOOKUP finds a value in one range and returns the matching value from another: =XLOOKUP(B13,B2:B11,D2:D11). It's the newer function that replaces VLOOKUP, HLOOKUP and most INDEX and MATCH, looks left, takes an if-not-found value, and with search mode -1 finds the last match: =XLOOKUP(B13,B2:B11,D2:D11,,0,-1). It needs Microsoft 365 or Excel 2021, and older versions show #NAME?.

Using Google Sheets? Do this lesson in Sheets.

=XLOOKUP(B13,B2:B11,C2:C11)

What you'll practise

Look up a product's first and latest cost in a supplier price log, look left for the date it last changed, and handle a code that isn't there, all with XLOOKUP.

4 steps · 40 points · the cells outlined in gold below

  • XLOOKUP
  • if not found
  • search from the bottom
  • left lookup

The data

ABCD
1Effective fromSKUProductUnit cost ($)
201/07/2025BG-1042Deck screws 500pk$18.40
301/07/2025BG-2207Pine sleeper 2.4m$22.95
415/08/2025BG-3318Exterior primer 4L$41.60
501/09/2025BG-1042Deck screws 500pk$19.15
606/10/2025BG-4471Garden hose 30m$34.80
703/11/2025BG-2207Pine sleeper 2.4m$24.10
812/01/2026BG-3318Exterior primer 4L$43.25
902/02/2026BG-1042Deck screws 500pk$19.85
1016/03/2026BG-5590Wheelbarrow 100L$87.50
1101/04/2026BG-2207Pine sleeper 2.4m$25.40
12
13SKUBG-2207
14Product
15First cost ($)
16Latest cost ($)
17Last changed
18
19New SKUBG-6012
20Product

Semester pass · A$49 for six months

This drill comes with the semester pass.

Every lesson, for A$49 every six months. Cancel any time and you keep the pass until the six months you've paid for run out.