XLOOKUP
searches range and returns matching item
signature
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
returns: any
| argument | required |
|---|---|
| lookup_value | required |
| lookup_array | required |
| return_array | required |
| if_not_found | optional |
| match_mode | optional |
| search_mode | optional |
examples
formula and result, taken from the engine's own test suite — every result below is asserted in CI, not written by hand.
| A | B | C | |
|---|---|---|---|
| 1 | 10 | alpha | |
| 2 | 20 | beta | |
| 3 | 30 | gamma | |
| 4 | 40 | delta | |
| 5 | 50 | epsilon |
fx
=XLOOKUP("beta", C1:C5, A1:A5) 20 related
- ADDRESS returns a cell address as text from row and column numbers
- AREAS returns the number of areas in a reference
- HLOOKUP searches first row and returns matching value
- INDEX returns value at row and column in range
- INDIRECT returns reference specified by text string
- LOOKUP looks up value in one-row or one-column range