# Lookups: XLOOKUP, INDEX/MATCH and Friends

> Joining tables inside a spreadsheet reliably, handling missing matches, and understanding exact vs approximate matching. Free notes, key concepts, resources...

Canonical: https://www.internhack.in/roadmaps/tracks/data-analyst/spreadsheet-lookups
Last updated: 2026-11-28

Joining tables inside a spreadsheet reliably, handling missing matches, and understanding exact vs approximate matching.

Beginner · about 4 hours · difficulty 2/5

Learn first: [Formulas and Functions That Matter](https://www.internhack.in/roadmaps/tracks/data-analyst/spreadsheet-formulas)

Lookups are how spreadsheets join tables: bring the customer segment into the orders sheet, the price into the order lines, the target into the actuals.

### The options

- **XLOOKUP** (Excel 365, also in Google Sheets): `=XLOOKUP(key, lookup_col, return_col, "Not found")`. Exact match by default, can search from the bottom, returns whole rows. Use this when available.
- **INDEX/MATCH**: `=INDEX(return_col, MATCH(key, lookup_col, 0))`. Works everywhere, does not break when columns are inserted, and supports two-way lookups with two MATCHes.
- **VLOOKUP**: widely used in legacy files. Know how to read it, but note its weaknesses: it only looks right, and a hard-coded column number breaks when columns move. Always pass `FALSE` for exact matching.

### Approximate matching

Approximate (sorted) matching is useful for banding: tax brackets, grade boundaries, commission tiers. Keep a small sorted threshold table and look up with match mode -1 or 1.

### Checking your joins

- Are keys unique in the lookup table? Duplicates mean you silently get the first match.
- Do keys match exactly? Trailing spaces, text vs number, and case differences cause misses.
- Count how many rows returned "not found" and investigate them.

**Pitfall:** wrapping everything in IFERROR so missing matches look like zeros. Move on when you can join two tables, report the match rate, and explain every unmatched row.

## Key concepts

- **XLOOKUP**
- **INDEX and MATCH**
- **Reading VLOOKUP and HLOOKUP**
- **Two-way lookups**
- **Approximate match for banding**
- **Diagnosing missing matches**: Spaces, types, duplicates

## Mini project

Take an orders table and a separate product catalogue, bring category and unit cost into each order with XLOOKUP, compute margin, and report how many orders failed to match and why.

## Check yourself

Your lookup table has two rows for the same product id. What happens to your XLOOKUP results, and how would you detect it?

## Free resources

- [Excel help and learning](https://support.microsoft.com/en-us/excel) (Microsoft)
- [Google Sheets function list](https://support.google.com/docs/table/25273) (Google)

Previous: [Formulas and Functions That Matter](https://www.internhack.in/roadmaps/tracks/data-analyst/spreadsheet-formulas) · Next: [Pivot Tables and Summary Reporting](https://www.internhack.in/roadmaps/tracks/data-analyst/pivot-tables)

## More in Spreadsheets as a Serious Analysis Tool

- [Spreadsheet Foundations and Good Structure](https://www.internhack.in/roadmaps/tracks/data-analyst/spreadsheet-foundations)
- [Formulas and Functions That Matter](https://www.internhack.in/roadmaps/tracks/data-analyst/spreadsheet-formulas)
- [Lookups: XLOOKUP, INDEX/MATCH and Friends](https://www.internhack.in/roadmaps/tracks/data-analyst/spreadsheet-lookups)
- [Pivot Tables and Summary Reporting](https://www.internhack.in/roadmaps/tracks/data-analyst/pivot-tables)
- [Charts and Simple Dashboards in Spreadsheets](https://www.internhack.in/roadmaps/tracks/data-analyst/spreadsheet-charts)
- [Power Query, Data Validation and Repeatable Cleanup](https://www.internhack.in/roadmaps/tracks/data-analyst/power-query-validation)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Data Analyst Roadmap](https://www.internhack.in/roadmaps/tracks/data-analyst)
