# RSQ Function

> Return R-squared, the square of the Pearson correlation of two data sets, with RSQ in TX Sheet Control: arrays of equal size and the #N/A and #DIV/0! errors.

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

---

Return the square of the Pearson correlation coefficient, the share of the variance of `known_y` that a linear relation to `known_x` explains. `known_y` and `known_x` are ranges or arrays of the same size; the result is from 0 to 1. Ranges of different sizes return `#N/A`, and values without variance return `#DIV/0!`.

### Syntax

```text
RSQ(known_y, known_x, x)
```

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

Available for supported offline calculation.

### Examples

```text
=RSQ({1,2,3},{2,4,6})
```

The formula returns 1, because the values 2, 4 and 6 are exactly twice 1, 2 and 3.

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:** [RRI Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/rri/llms-full.txt)
- **Next:** [RTD Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/rtd/llms-full.txt)
