Example 1
How well does spend explain sign-ups?
D2 =ROUND(RSQ(B2:B7,A2:A7),4)
Result: 0.9708
About 97% of the variation in sign-ups follows a straight-line relationship with spend.
D2 =ROUND(RSQ(B2:B7,A2:A7),4) returns 0.9708
Returns R squared, the share of the variation in one set of values that a straight-line relationship with another set explains.
Syntax
=RSQ(, )
All versions of Excel.
Try it
Edit the formula in D2 or change the inputs. The sheet recalculates as you type.
D2 =ROUND(RSQ(B2:B7,A2:A7),4) returns 0.9708
RSQ returns R squared, also called the coefficient of determination. It is a number from 0 to 1 that tells you how much of the movement in one series is explained by a straight-line relationship with another. =RSQ(B2:B7,A2:A7) returns 0.9708 when 97% of the variation in sign-ups is explained by spend.
RSQ is the square of the correlation coefficient. =RSQ(B2:B7,A2:A7) equals =CORREL(B2:B7,A2:A7)^2, and also =PEARSON(A2:A7,B2:B7)^2.
Squaring removes the direction. A series that falls as the other rises, with a correlation of -0.9954, has an RSQ of 0.9909, the same as if it had risen. If direction matters, use CORREL or PEARSON alongside it, or check the sign of SLOPE.
known_ys and known_xs are ranges of numbers of the same size. The order does not change RSQ, because the squared correlation is symmetric. Pairs where either value is text, logical or empty are ignored in references, but ranges of different sizes return #N/A. If one series never changes, RSQ returns #DIV/0!, because there is no variation to explain.
A high R squared shows a line fits the data you have. It does not prove that one thing causes the other, and it says nothing about data outside the range you measured. A few extreme points can inflate it. Plot the data before you rely on the number.
Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
D2 =ROUND(RSQ(B2:B7,A2:A7),4)
Result: 0.9708
About 97% of the variation in sign-ups follows a straight-line relationship with spend.
D2 =ROUND(RSQ(B2:B7,A2:A7),4) returns 0.9708
Example 2
D2 =ROUND(RSQ(B2:B7,A2:A7),4)
Result: 0.0013
A value near 0 means a straight line through the points explains almost none of the variation.
D2 =ROUND(RSQ(B2:B7,A2:A7),4) returns 0.0013
Example 3
D2 =ROUND(RSQ(B2:B7,A2:A7),4)
Result: 0.9909
Units fall as the price step rises, yet RSQ is high because squaring hides the direction. CORREL would return -0.9954.
D2 =ROUND(RSQ(B2:B7,A2:A7),4) returns 0.9909
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In D2, return R squared for sign-ups (B2:B7) against spend (A2:A7).
Answer in D2.
#N/A, and a series with no variation returns #DIV/0!.It depends on the field. In tightly controlled processes you expect 0.95 or more. For human behaviour, 0.3 can be useful. A high value only shows the line fits the data you have.
CORREL returns the correlation coefficient, from -1 to 1, with a sign. RSQ is that number squared, from 0 to 1, with no sign.
No. R squared is the same whichever series you put first, although the convention is known_ys first.
One of the series has no variation, for example every value is the same, so there is nothing for a line to explain.
Tracks take you from the basics to modelling, one graded exercise at a time.