# CHITEST Function

> Run a chi-squared test of independence with the CHITEST formula function of TX Sheet Control: observed and expected ranges, the p-value result and its errors.

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

---

Return the p-value of a chi-squared test of independence. `actual_range` holds the observed frequencies and `expected_range` the expected frequencies, with the same number of rows and columns. The result is the probability that the observed values differ from the expected ones by chance alone, so a small value indicates a significant difference. Ranges of different sizes return `#N/A`, and an expected value of 0 returns `#DIV/0!`. CHITEST is the compatibility version of [CHISQ.TEST](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/chisq-test/llms-full.txt).

### Syntax

```text
CHITEST(actual_range, expected_range)
```

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

Available for supported offline calculation.

### Examples

```text
=CHITEST({10,20;20,10},{15,15;15,15})
```

The formula returns 0.0098, the probability of a chi-squared value of 6.67 with one degree of freedom.

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:** [CHISQ.TEST Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/chisq-test/llms-full.txt)
- **Next:** [CHOOSE Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/choose/llms-full.txt)
