# PERCENTILE Function

> Return the k-th percentile of a data set with PERCENTILE in TX Sheet Control, inclusive of 0 and 1: interpolation, PERCENTILE.INC and the #NUM! error.

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

---

Return the k-th percentile of a set of values, with k from 0 to 1 inclusive. `array` holds the values and `k` the percentile; between two values, PERCENTILE interpolates. A `k` outside 0 to 1, or an `array` without numbers, returns `#NUM!`. PERCENTILE returns the same results as `PERCENTILE.INC`.

### Syntax

```text
PERCENTILE(array, k)
```

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

Available for supported offline calculation.

### Examples

```text
=PERCENTILE({1,2,3,4},0.5)
```

The formula returns 2.5, the median of 1, 2, 3 and 4.

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:** [PEARSON Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/pearson/llms-full.txt)
- **Next:** [PERCENTILE.EXC Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/percentile-exc/llms-full.txt)
