# AVERAGEIF Function

> Average the numbers that meet one condition with AVERAGEIF in TX Sheet Control: criteria such as >20000, a separate average range and the #DIV/0! error.

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

---

Return the average of the numbers that meet a condition. `range` is the range the condition is tested on, and `criteria` the condition, such as `">20000"`, `"<>x"` or a value to match. `average_range` is the range whose numbers are averaged, cell by cell with `range`; without it, the numbers of `range` itself are averaged. When no cell meets the condition, AVERAGEIF returns `#DIV/0!`.

### Syntax

```text
AVERAGEIF(range, criteria, average_range)
```

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

Available for supported offline calculation.

### Examples

```text
=AVERAGEIF(B4:D6,">20000")
```

The formula returns the average of the numbers in B4:D6 that are greater than 20,000.

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:** [AVERAGEA Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/averagea/llms-full.txt)
- **Next:** [AVERAGEIFS Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/averageifs/llms-full.txt)
