# RANK Function

> Rank a number in a list with the RANK formula function of TX Sheet Control: descending or ascending order, equal numbers and the #N/A error explained.

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

---

Return the rank of a number in a list of numbers. `number` is the number to rank and `ref` the list; `order` 0 or omitted ranks in descending order, with the largest number as 1, and any other value in ascending order. Equal numbers get the same rank, and a number that isn't in the list returns `#N/A`. RANK calculates the same as [RANK.EQ](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/rank-eq/llms-full.txt).

### Syntax

```text
RANK(number, ref, order)
```

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

Available for supported offline calculation.

### Examples

```text
=RANK(3,A1:A5)
```

When A1:A5 holds the values 1 to 5, the formula returns 3: 3 is the third largest value.

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:** [RANDBETWEEN Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/randbetween/llms-full.txt)
- **Next:** [RANK.AVG Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/rank-avg/llms-full.txt)
