# XLOOKUP Function

> An Excel formula that finds a code in one column. It gives back what sits on that same row.

**Field:** Business & Startups  
**Category:** Tools & Software  
**Also known as:** XLOOKUP, Microsoft Excel XLOOKUP

## Think of it like

It is like finding a name on a class list. Then you read the phone number on the same line.

## Definition

XLOOKUP is an Excel formula that finds a value in one column and returns its match from another. You give it three things: what to find, where to look and what to bring back. It looks for an exact match unless you ask for something else. If nothing matches, it shows #N/A, or a message you choose. The answer column can sit to the left or the right of the search column. It works in Excel for Microsoft 365, Excel 2021 and later, and Excel on the web.

## Example

Lucy has 500 staff IDs in column A and email addresses in column D. She types an ID into F2, and =XLOOKUP(F2, A2:A501, D2:D501) shows that person's email.

## Example code

```excel
     A        B          C
1    Code     Item       Price
2    P-101    Pencil     0.80
3    P-102    Notebook   4.50
4    P-103    Ruler      1.20

=XLOOKUP("P-102", A2:A4, C2:C4, "Not found")
4.50
```

It finds P-102 in column A, then returns 4.50 from the same row of column C.

## Why it matters

Joining two lists by a shared code is one of the most common jobs in a spreadsheet. XLOOKUP does it in one short formula.

## Common mistake

Leaving out the dollar signs, like $A$2:$A$501, before copying the formula down. The ranges then slide down a row each time, and later rows miss part of the list.

## Three principles

- **Three inputs.** What to find, where to look, what to return.
- **Exact by default.** No match shows #N/A or your own message.
- **Either side.** The answer column can sit left or right.

## Related terms

- [Microsoft Excel](https://learn.benibix.com/term/business/microsoft-excel)
- [Microsoft 365](https://learn.benibix.com/term/business/microsoft-365)
- [Pivot Table](https://learn.benibix.com/term/data/pivot-table)
- [Reference Data](https://learn.benibix.com/term/data/reference-data)

![A small table with columns Code, Item and Price. An arrow runs down the Code column, past P-101, and stops on P-102. A second arrow runs along that row to the Price column, where 4.50 is in the accent colour. Three numbered steps sit to the right, and the formula XLOOKUP of P-102, A2 to A4, C2 to C4 sits below the table.](https://learn.benibix.com/diagrams/wpa-xlookup.svg)

---

Source: https://learn.benibix.com/term/business/xlookup
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
