# LOOKUP Function

> Look up a value in a sorted row or column with LOOKUP in TX Sheet Control: the vector and the array form, the nearest smaller match and the #N/A error.

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

---

Look up a value in a sorted row or column and return the value at the same position in another. In the vector form, `lookup_value` is searched in `table_or_lookup_vector`, sorted in ascending order, and the value at the same position in `row_or_result_vector` is returned; without an exact match, the largest value smaller than `lookup_value` is used. With two arguments, the array form searches the first row of a wide array, or the first column of a tall one, and returns the value from the last row or column. A `lookup_value` smaller than every value returns `#N/A`. The catalog accepts three arguments; `range_lookup` in the syntax is not used.

### Syntax

```text
LOOKUP(lookup_value, table_or_lookup_vector, row_or_result_vector, range_lookup)
```

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

Available for supported offline calculation.

### Examples

```text
=LOOKUP(2,{1,2,3},{4,5,6})
```

The formula returns 5, the value at the position of 2.

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:** [LOGNORM.INV Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/lognorm-inv/llms-full.txt)
- **Next:** [LOWER Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/lower/llms-full.txt)
