The Foundation
Imagine walking into a giant library. You do not wander the shelves hunting — you go to the librarian, give the book's code, and they fetch the exact book. A lookup in Excel is exactly this. You hand Excel a key (something you already know), it searches a table (the catalogue), and it hands back the matching detail.
Take an everyday kirana price list: column A has item names, column B has prices. You know the item is Pen; you want its price. Reading it by eye is fine for five rows, but hopeless for five thousand. A lookup does the scanning for you, instantly, every single time.
One golden rule up front: your key should be unique in the list — like a roll number or an item name — so Excel knows exactly which row you mean.
There are three tools for this one job, and this module covers all three:
- VLOOKUP — the old classic. It finds your key down the first column, then counts columns to the right to return the answer.
- XLOOKUP — the modern upgrade. You simply point at the answer column; no counting, and it is exact by default.
- INDEX-MATCH — the flexible pair. MATCH says which row, INDEX says fetch from this column. It can even look to the left.
Master these and you have cracked the single most-asked skill in every Excel interview and office test.
Visual Architecture
Two quick maps: the first shows how the three tools relate; the second helps you pick the right one in seconds.
View Mermaid.js source
mindmap
root((Lookups))
VLOOKUP
Looks right only
Needs FALSE
Col index brittle
XLOOKUP
Any direction
Exact by default
Built in not found
INDEX MATCH
MATCH finds the row
INDEX fetches value
Can look left
Errors and match
NA when missing
IFERROR to guard
Exact vs approxView Mermaid.js source
flowchart TD
A[Need a value from a table] --> B{Have XLOOKUP}
B -->|Yes| C[Use XLOOKUP<br/>exact and any direction]
B -->|No| D{Key in the left column}
D -->|Yes| E[VLOOKUP with FALSE]
D -->|No or need robust| F[INDEX MATCH]
C --> G[Add if not found for a clean message]
F --> GThe Deep Dive
VLOOKUP means vertical lookup. It searches down the first column of a table for your key, then returns a value from a column to the right. It takes four arguments:
| # | Argument | What it means | Example |
|---|---|---|---|
| 1 | lookup_value | the key you already know | "Pen" |
| 2 | table_array | the block to search; the key must sit in its first column | A2:B6 |
| 3 | col_index_num | which column to return, counted from the left of the block | 2 |
| 4 | range_lookup | FALSE for an exact match, TRUE for approximate | FALSE |
So =VLOOKUP("Pen",A2:B6,2,FALSE) reads: find Pen in the first column of A2:B6, then give me the value in column 2 of that block, matching exactly. The famous rule: always end with FALSE. Leave it out and Excel switches to approximate matching, which can silently hand back the wrong row.
VLOOKUP has three well-known limits. It cannot look left — the key must be the first column and the answer must be to its right. Its col_index is brittle: it is a fixed number, so inserting a column inside the table makes the 2 point at the wrong data. Its horizontal twin, HLOOKUP, is identical but searches across the top row and returns a value from a row below — handy when data runs left to right instead of top down.
XLOOKUP fixes almost every VLOOKUP headache. Instead of counting columns you point at two ranges — the column to search and the column to return:
=XLOOKUP(lookup, lookup_array, return_array, [if_not_found])
- It looks in any direction — the return column may be left or right of the key.
- It is an exact match by default — no FALSE to remember.
- It has a built-in not-found reply: the optional 4th argument, as in =XLOOKUP("Pen",A2:A6,B2:B6,"Not found").
- Insert a column and nothing breaks, because you named ranges instead of counting.
If your Excel has XLOOKUP, make it your default lookup.
Before XLOOKUP existed, the robust choice was INDEX-MATCH, and it still works in every version of Excel. It splits the job in two: MATCH finds which row, then INDEX fetches the value from that row.
- =MATCH("Pen",A2:A6,0) returns the position of Pen in the list. The 0 means exact match — never forget it.
- =INDEX(B2:B6, 1) returns the value at position 1 of the price column.
Because you name the answer column yourself, INDEX-MATCH can look left, survives inserted columns, and can fetch from a completely different column than the one you searched.
Two-way lookup. Need a value by both a row and a column — say the marks for a given student and a given subject? Nest a second MATCH where the column number goes: =INDEX(data, MATCH(student, names, 0), MATCH(subject, headers, 0)). The first MATCH picks the row, the second picks the column. This is INDEX-MATCH-MATCH, the tidiest way to read a grid in both directions.
Approximate match and tiers. Sometimes you do not want an exact hit — you want a band. To turn marks into grades, sort a small band table ascending and use approximate match (VLOOKUP's 4th argument TRUE, or XLOOKUP's match mode). Excel then finds the largest key that is not greater than your value — so 82 lands in the 75 band:
| Marks from | Grade |
|---|---|
| 0 | Fail |
| 40 | Pass |
| 60 | First |
| 75 | Distinction |
Taming #N/A. A lookup returns #N/A when the key simply is not there. Wrap it to show something friendly: =IFERROR(VLOOKUP(...),0) shows 0 on failure, and XLOOKUP's 4th argument does the same job even more cleanly.
Here is the whole family side by side, so you can see why XLOOKUP and INDEX-MATCH have largely retired the bare VLOOKUP:
| Feature | VLOOKUP | XLOOKUP | INDEX-MATCH |
|---|---|---|---|
| Looks | right only | any direction | any direction |
| Exact match | needs FALSE | by default | MATCH with 0 |
| Not-found built in | no | yes, 4th arg | no |
| Survives an inserted column | no | yes | yes |
| Works in old Excel | yes | no | yes |
Expert Traps & Hacks
Lookups are where most people lose marks — usually to the same handful of mistakes. Learn these five and you will debug any broken lookup in seconds.
Interactive Sandbox — Formula Sandbox
Type a real lookup into the formula bar, press Run, and watch the target cell fill in — it turns green the instant your answer is right. Eight scenarios, gentlest first.