Skip to main content
Albero Academy

Lookup Functions in Depth

Pull matching data from another table — XLOOKUP, the classic VLOOKUP and its pitfalls, and the flexible INDEX/MATCH combo.

Chapter 8Excel16 min readBeginner friendly
  • #Excel
  • #XLOOKUP
  • #VLOOKUP

Lookups are Excel's most valuable skill: given a value in one table, find the matching detail in another — a price for a product code, a name for an id. This is how you connect separate sheets. Modern XLOOKUP is the best tool; you'll also meet the older functions you'll see in existing files.

Why lookups?

Instead of copy-pasting data between sheets (which drifts out of sync), a lookup formula pulls the current value live. Change the source and every lookup updates.

XLOOKUP

XLOOKUP (modern Excel) is the one to learn — flexible, readable and safe: =XLOOKUP(what, where-to-look, what-to-return):

XLOOKUP
=XLOOKUP(A2, products[code], products[price])
look up A2 in the code column return the price
With a not-found message:
=XLOOKUP(A2, codes, prices, "Not found")
It searches left or right, returns whole rows, and needs no column counting.

VLOOKUP & its pitfalls

VLOOKUP is everywhere in older files. It works but has real pitfalls: it can only look rightward, breaks if you insert a column (the index number is hard-coded), and defaults to an approximate match:

VLOOKUP — handle with care
=VLOOKUP(A2, table, 3, FALSE)
value range col# FALSE = EXACT match (always pass FALSE!)
Pitfalls:
• The lookup column must be the LEFTMOST of the range.
• Column 3 is counted from the range — inserting a column breaks it.
• Omitting FALSE gives a silent, wrong approximate match.

INDEX / MATCH

Before XLOOKUP, INDEX + MATCH was the pro alternative to VLOOKUP — it can look in any direction and survives column inserts. You'll still see it a lot:

INDEX(return-range, MATCH(value, lookup-range, 0))
=INDEX(prices, MATCH(A2, codes, 0))
MATCH finds the row number of A2 in 'codes' (0 = exact),
INDEX returns that row's value from 'prices'.

Practice

With a products table (code, name, price), use XLOOKUP to fetch a price by code with a "Not found" fallback. Rebuild the same lookup with INDEX/MATCH, and note why VLOOKUP would break if you inserted a column in the middle.

Key takeaways

  1. 01Lookups pull matching data from another table live — better than copy-pasting.
  2. 02XLOOKUP(value, lookup-range, return-range[, if-not-found]) is the modern default — flexible & safe.
  3. 03VLOOKUP is common in old files but only looks right, breaks on column inserts, and needs FALSE for exact match.
  4. 04INDEX(return, MATCH(value, lookup, 0)) is the flexible classic alternative.
  5. 05Prefer XLOOKUP; when maintaining old files, understand VLOOKUP's pitfalls.