How to use INDEX and MATCH in Excel (instead of VLOOKUP)
In Excel for Microsoft 365 / Excel 2021–2024 (verified 2026-10-24), INDEX returns a cell from a range, and MATCH finds a value's position. Together:
=INDEX(return_range, MATCH(lookup_value, lookup_range, 0))
Use 0 (exact match) in MATCH for IDs and names. Unlike classic VLOOKUP, INDEX/MATCH can return a column to the left of the lookup column and survives many column inserts. On Microsoft 365, also consider XLOOKUP.
Applies to Excel for Microsoft 365, Excel 2021/2024, Excel for Mac and Excel for the web. INDEX/MATCH is still widely used in shared workbooks that must open in older Excel, and in models where the return column sits left of the key.
Build an INDEX/MATCH lookup
Example: employee IDs in column A, names in column B. You want the name for the ID typed in E2.
Exact match for a name
- In the result cell type:
=INDEX(B2:B100, MATCH(E2, A2:A100, 0)). - Press Enter. MATCH finds the row where
E2appears inA2:A100; INDEX returns the same row fromB2:B100. - Copy the formula down if E3, E4… hold more IDs — lock ranges with
$if needed (see absolute references).
Look to the left (VLOOKUP cannot)
- If names are in A and IDs in B, and you have a name in E2, use:
=INDEX(B2:B100, MATCH(E2, A2:A100, 0))to return the ID. - VLOOKUP would require rearranging columns; INDEX/MATCH does not.
Two-way lookup
- To pull a value at the intersection of a row label and column label:
=INDEX(data_range, MATCH(row_key, row_headers, 0), MATCH(col_key, col_headers, 0))- Keep
data_rangealigned with those headers — off-by-one ranges are the usual bug.
INDEX/MATCH vs VLOOKUP vs XLOOKUP
| Need | Prefer |
|---|---|
| Microsoft 365 / Excel 2021+ and simple API | XLOOKUP — see VLOOKUP/XLOOKUP guide |
| Workbook must open in Excel 2016 or older | INDEX/MATCH |
| Return column left of key | INDEX/MATCH or XLOOKUP (not classic VLOOKUP) |
| Two-way lookup (row + column headers) | INDEX with two MATCH calls |
Our take: new sheets on Microsoft 365 should default to XLOOKUP. Learn INDEX/MATCH so you can read and repair older models.
If it fails
- #N/A: no exact match. Check extra spaces (
TRIM), number-stored-as-text, or wrong sheet. - Wrong row: MATCH without
0may approximate. Always use0for IDs. - #REF!: INDEX range is smaller than MATCH's position — extend the INDEX range.
- Slow workbook: whole-column refs like
A:Aon huge sheets cost CPU — use limited ranges or Tables. - Multiple matches: MATCH returns the first. Deduplicate keys or use FILTER on Microsoft 365.
Worked patterns
- Percentage of a lookup table: combine with absolute references so the table does not slide when filled down.
- IF + lookup:
=IFERROR(INDEX(...), "")to hide #N/A on empty inputs. - Case-sensitive needs: standard MATCH is not case-sensitive — use more advanced array techniques or helper columns.
Frequently asked questions
Is INDEX MATCH better than VLOOKUP?
It is more flexible (left lookup, column inserts). On Microsoft 365, XLOOKUP is usually clearer for new work.
What does the 0 in MATCH mean?
Exact match. Use it for IDs, emails and names.
Can INDEX MATCH return multiple columns?
One formula returns one cell. Use separate formulas, or FILTER/XLOOKUP dynamic arrays on Microsoft 365.
Does INDEX MATCH work in Google Sheets?
Yes — same functions. Sheets also has FILTER and XLOOKUP in current accounts.
Why did inserting a column break VLOOKUP but not INDEX/MATCH?
VLOOKUP often uses a fixed column index number; INDEX points at a range that can shift cleanly with inserts.