The Excel RSQ function returns the square of the Pearson correlation coefficient (R²) for two data sets — the proportion of variance in the y-values explained by the x-values in a linear fit.
Syntax
| Argument | Description | |
|---|---|---|
known_ys | Required | The array or range of dependent (y) data points. |
known_xs | Required | The array or range of independent (x) data points. Must have the same count as known_ys. |
How to use it
RSQ measures how well a straight line fits two paired data sets. The result ranges from 0 (no linear relationship) to 1 (a perfect line). It is literally the square of what CORREL returns.
Because R² is the square of the correlation, =RSQ(...) equals =CORREL(...)^2 for the same data. The two arrays must contain the same number of points.
Reading R²: an R² of 0.81 means about 81% of the variation in y is explained by the linear relationship with x. The remaining 19% comes from other factors or noise.
Try it: interactive demo
Pick a RSQ example to see the formula and its result.
Practice workbook
Frequently asked questions
What does RSQ actually measure?
How is RSQ related to CORREL?
=RSQ(ys,xs) equals =CORREL(ys,xs)^2 for the same data.Does the order of arguments matter?
What if the arrays are different sizes?
Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class