# XMATCH Function

> Return the position of a value in a row, column or array with XMATCH in TX Sheet Control: exact, approximate and wildcard matches, search modes and #N/A errors.

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

---

Return the relative position of a value in a row, column or array. `lookup_value` is the value to find and `lookup_array` where to search. `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; another mode returns `#VALUE!`. `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. A value that is not found returns `#N/A`.

### Syntax

```text
XMATCH(lookup_value, lookup_array, match_mode, search_mode)
```

Category: Lookup. Minimum arguments: 2. Maximum arguments: 4.

Available for supported offline calculation.

### Examples

```text
=XMATCH(3,{1,2,3},0)
```

The formula returns 3, the position of 3 in the array.

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:** [XLOOKUP Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/xlookup/llms-full.txt)
- **Next:** [XNPV Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/xnpv/llms-full.txt)
