# CORREL Function

> Calculate the correlation coefficient of two data sets with the CORREL formula function of TX Sheet Control: the range from -1 to 1 and its errors.

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

---

Return the correlation coefficient of two data sets. `known_y` and `known_x` are ranges or arrays with the same number of values. The result is from -1 to 1: 1 means a perfect positive linear relationship, -1 a perfect negative one and 0 none. Sets of different size return `#N/A`, and a set whose values are all equal returns `#DIV/0!`.

### Syntax

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

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

Available for supported offline calculation.

### Examples

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

The formula returns 1, because each value of the second set is twice the value of the first.

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:** [CONVERT Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/convert/llms-full.txt)
- **Next:** [COS Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/cos/llms-full.txt)
