Statistical function

RSQ function

Returns R², the share of the variation in y that a straight-line relationship with x explains (0 to 1).

Available in All versions of Excel, including Microsoft 365 and Excel for the web

In every Excel versionWorks in Google Sheets

Syntax

RSQ(known_y's, known_x's)
ArgumentWhat it means
known_y'sRequiredThe dependent values (what you want to explain).
known_x'sRequiredThe independent values, the same number of points.

Returns: A number between 0 and 1.

How RSQ works

R-squared answers the question "how well does a straight line fit my data?". It is the share of the ups and downs in y that can be explained by x through a linear relationship. An R² of 0.9 means 90% of the variation in sales lines up with the variation in advertising spend; the remaining 10% is due to other factors or noise. An R² near 0 means a straight line is no better than simply predicting the average every time.

RSQ equals the square of PEARSON (or CORREL), and it matches the R² shown on a chart trendline and in row 3 of LINEST with statistics. A high R² does not prove that x causes y, and a low R² does not mean there is no relationship at all; it might simply be curved. Pairs containing text, logical values or blanks are ignored.

Examples

1How much of sales does ad spend explain?

D2fx=RSQ(B2:B6, A2:A6)
ABCD
1Ad spend (k)Sales (k)
22410.9974
3452
4558
5770
6979

Result: 0.9974

R² = 0.997422 (shown to 4 decimals): advertising spend accounts for over 99% of the variation in sales in this sample, a very tight linear fit.

2A weaker relationship

D2fx=RSQ(B2:B7, A2:A7)
ABCD
1Study hoursExam score
22650.5852
3570
4158
5688
6462
7374

Result: 0.5852

R² = 0.585152 (shown to 4 decimals). Study time explains only about 59% of the differences in scores; other factors matter a lot.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe two ranges have different numbers of points.Use ranges of the same size.
#DIV/0!Only one data point, or one of the ranges has no variation.Provide at least two different values in each range.

Tips

  • The argument order (y, x) does not change the result of RSQ, but keep it consistent with SLOPE and INTERCEPT to avoid confusion.
  • For curved data, try =RSQ(LN(y), x) to see how well an exponential model fits.

Google Sheets

RSQ also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

RSQ in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechRKQ
DanishFORKLARINGSGRAD
DutchR.KWADRAAT
FinnishPEARSON.NELIÖ
FrenchCOEFFICIENT.DETERMINATION
GermanBESTIMMTHEITSMASS
HungarianRNÉGYZET
ItalianRQ
Norwegian (Bokmål)RKVADRAT
PolishR.KWADRAT
Portuguese (Brazil)RQUAD
Portuguese (Portugal)RQUAD
RussianКВПИРСОН
SpanishCOEFICIENTE.R2
SwedishRKV
TurkishRKARE