# QUARTILE Function

> Return the minimum, quartiles, median or maximum of values with QUARTILE in TX Sheet Control: k from 0 to 4, truncation and the #NUM! error explained.

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

---

Return a quartile of a data set. `array` holds the values and `k` selects the quartile, truncated to an integer: 0 (the smallest value), 1 (the first quartile, 25%), 2 (the median), 3 (the third quartile, 75%) or 4 (the largest value). A `k` outside 0 to 4 returns `#NUM!`. QUARTILE calculates the same as [QUARTILE.INC](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/quartile-inc/llms-full.txt).

### Syntax

```text
QUARTILE(array, k)
```

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

Available for supported offline calculation.

### Examples

```text
=QUARTILE(A1:A5,2)
```

When A1:A5 holds the values 1 to 5, the formula returns 3, the median.

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