Lookups · About 6 minutes
Practice choosing a lookup
Each task here needs a lookup, but not always the same one. Read the task first and ask two questions.
Is the answer an exact match or a band? Bands need an approximate match: VLOOKUP with TRUE (or XLOOKUP with -1 as its match mode). Is the answer to the left of the column you search? Then VLOOKUP can't reach it, so use XLOOKUP or INDEX and MATCH.
Part of Plus
Free during our founding launch: sign in to unlock this lesson's exercises, the timed practice sets and the rest of Plus. The free lessons stay free, with no account needed.
What this practice covers
This practice mixes the lookups you've learned: VLOOKUP with an exact match, VLOOKUP with an approximate match for bands, XLOOKUP, and INDEX with MATCH. Each task tells you what to find, but not which function to use.
The skill is choosing. Before you type, ask: is it an exact code or a band? Is the answer to the right of the column you search, or to the left? Should a missing value show a message instead of #N/A? Lookup tasks like these are common in office and analyst skills tests.
The formulas you'll use
=VLOOKUP(
- VLOOKUP
- Searches the first column of a table and brings back a column to its right, by number.
FALSEfor exact,TRUEfor bands.
=XLOOKUP(
- XLOOKUP
- Searches one column and brings back the same row of another, left or right. Exact by default, with an optional not-found message.
=INDEX(
- INDEX and MATCH
- MATCH finds the position, INDEX brings back the value at that position. It looks left and works in every version.
A worked example
A desk plan lists the desk first and each staff ID after it. In B8, find the desk for the ID in B7.
| A | B | C | |
|---|---|---|---|
| 1 | Desk | Staff ID | Team |
| 2 | D-01 | S48 | Sales |
| 3 | D-02 | S12 | Ops |
| 4 | D-03 | S77 | Sales |
| 5 | D-04 | S30 | HR |
| 6 | |||
| 7 | Staff ID | S77 | |
| 8 | Desk | D-03 |
=INDEX( A2:A5, MATCH( B7, B2:B5, 0))The desk is to the left of the ID, so VLOOKUP can't reach it. Find where S77 sits in B2:B5 (3rd), then bring back the 3rd value in A2:A5. It shows D-03.Mistakes to watch for
#N/A when the answer is to the left
VLOOKUP only brings back columns to the right of the one it searches. Switch to XLOOKUP, or INDEX and MATCH, which can point at any column.
An exact code gives a nearby row
Add FALSE as the last part of VLOOKUP, or 0 as the last part of MATCH. Left out, both use approximate match.
A band lookup gives #N/A
Bands need approximate match: TRUE in VLOOKUP, with the first column sorted from smallest to largest.
Which lookup should you use?
Exact code, answer to the right, any version: VLOOKUP with FALSE. A band, like a commission tier: VLOOKUP with TRUE on a sorted table. Answer to the left, or a message when nothing is found: XLOOKUP in Microsoft 365, Excel 2021 or later, and Google Sheets. The same in Excel 2019 or older: INDEX and MATCH.
If several would work, choose the one the file's readers can open. The XLOOKUP and INDEX and MATCH lessons each compare their function with VLOOKUP in more detail.
Questions people ask
Which is better: VLOOKUP, XLOOKUP or INDEX MATCH?
XLOOKUP is simplest when everyone has a recent version. INDEX MATCH works everywhere and can look left. VLOOKUP is fine for exact matches when the answer is to the right.
Is VLOOKUP still worth learning?
Yes. A huge number of existing files use it, and job tests still ask for it by name.
Which lookups come up in Excel job tests?
VLOOKUP with an exact match is the one most tests name. Some also ask for XLOOKUP, INDEX MATCH or a band lookup.
What should I use if the file must open in Excel 2019?
Use VLOOKUP or INDEX MATCH. XLOOKUP shows #NAME? in Excel 2019 and older.