# XLOOKUP Function

> Find a value and return its matching item with XLOOKUP in TX Sheet Control: if_not_found, exact, next smaller, next larger and wildcard matches, search modes.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > XLOOKUP Function
- **273 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/xlookup/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/xlookup/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/xlookup/llms-full.txt

---

Find a value in a row or column and return the matching item of another row or column. `lookup_value` is the value to find, `lookup_array` the row or column to search and `return_array` the values to return; a `return_array` with several columns returns the whole row. `if_not_found` is returned when there is no match (`#N/A` otherwise). `match_mode` is 0 for an exact match (the default), -1 for the next smaller item, 1 for the next larger item or 2 for a wildcard match. `search_mode` is 1 to search from the first item (the default), -1 from the last, and 2 or -2 for a binary search of sorted data.

### Syntax

```text
XLOOKUP(lookup_value, lookup_array, return_array, if_not_found, match_mode, search_mode)
```

Category: Lookup. Minimum arguments: 3. Maximum arguments: 6.

Available for supported offline calculation.

### Examples

```text
=XLOOKUP("Product sales",A4:A6,B4:B6,"Not found")
```

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [XIRR Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/xirr/llms-full.txt)
- **Next:** [XMATCH Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/xmatch/llms-full.txt)
