# XMATCH

lookup · from excel · excel: verified match · no sheets equivalent

returns the position of an item in a range or array

## signature

```
XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])
```

returns: `number`

## arguments

- lookup_value: any: required
- lookup_array: range: required
- match_mode: number: optional
- search_mode: number: optional

## examples

formula and result, asserted in the engine test suite.

| formula | result | with |
| --- | --- | --- |
| `=XMATCH("gamma", C1:C5)` | `3` | C1=alpha, C2=beta, C3=gamma, C4=delta, C5=epsilon |

## errors

error values observed from the engine: each with a call that produces it.

| error | produced by |
| --- | --- |
| `#N/A` | `=XMATCH(42,A1:A2,3)` |

## related

- [ADDRESS](https://deepcalc.com/docs/functions/address.md): returns a cell address as text from row and column numbers
- [AREAS](https://deepcalc.com/docs/functions/areas.md): returns the number of areas in a reference
- [HLOOKUP](https://deepcalc.com/docs/functions/hlookup.md): searches first row and returns matching value
- [HYPERLINK](https://deepcalc.com/docs/functions/hyperlink.md): the text a link displays: clickability is the renderer's
- [INDEX](https://deepcalc.com/docs/functions/index.md): returns value at row and column in range
- [INDIRECT](https://deepcalc.com/docs/functions/indirect.md): returns reference specified by text string
- [LOOKUP](https://deepcalc.com/docs/functions/lookup.md): looks up value in one-row or one-column range
- [MATCH](https://deepcalc.com/docs/functions/match.md): returns position of value in a range

## navigate

- [all lookup functions](https://deepcalc.com/docs/functions/lookup-functions.md)
- [function index](https://deepcalc.com/docs/functions.md): all 602 functions
- [error values](https://deepcalc.com/docs/errors.md) · [concepts](https://deepcalc.com/docs/concepts.md) · [limits](https://deepcalc.com/docs/limits.md)
- [everything in one file](https://deepcalc.com/llms-full.txt)

source: https://deepcalc.com/docs/functions/xmatch