Skip to content

RSQ

Returns R squared, the share of the variation in one set of values that a straight-line relationship with another set explains.

Syntax

=RSQ(, )

Statistical

All versions of Excel.

Try it

Edit the formula in D2 or change the inputs. The sheet recalculates as you type.

D2
A
B
C
D
1
Spend
Sign-ups
R squared
2
1
12
0.9708
3
2
15
4
3
19
5
4
20
6
5
26
7
6
27
8

D2 =ROUND(RSQ(B2:B7,A2:A7),4) returns 0.9708

How RSQ works

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.

Reading the result

  • Close to 1: the points sit tightly around a straight line. A trend line fits well and a forecast built on it is reasonable.
  • Close to 0: a straight line explains almost nothing. The two series may be unrelated, or related in a way a line can't show.
  • In between: a line explains part of the pattern. What counts as "good" depends on the field. Noisy human behaviour rarely gives values near 1.

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.

Sign is lost

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.

The two arguments

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.

What it does not tell you

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.

Common uses

  • Trend check before forecasting: compare RSQ with a threshold before you trust FORECAST or SLOPE and INTERCEPT.
  • Comparing drivers: run RSQ for several candidate drivers of the same outcome and see which explains most.
  • Quality checks: confirm a calibration or a cost model behaves like a straight line.

Arguments

known_ys
The dependent values, such as sign-ups. This is the outcome you want to explain.
known_xs
The independent values, such as marketing spend. It must hold the same number of values as known_ys, paired by position.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

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
A
B
C
D
1
Spend
Sign-ups
R squared
2
1
12
0.9708
3
2
15
4
3
19
5
4
20
6
5
26
7
6
27
8

D2 =ROUND(RSQ(B2:B7,A2:A7),4) returns 0.9708

Example 2

Two unrelated series

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
A
B
C
D
1
Week
Complaints
R squared
2
1
5
0.0013
3
2
2
4
3
6
5
4
3
6
5
5
7
6
4
8

D2 =ROUND(RSQ(B2:B7,A2:A7),4) returns 0.0013

Example 3

A falling relationship still scores high

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
A
B
C
D
1
Price step
Units
R squared
2
1
9
0.9909
3
2
8
4
3
6
5
4
5
6
5
3
7
6
2
8

D2 =ROUND(RSQ(B2:B7,A2:A7),4) returns 0.9909

Your turn.

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.

D2
A
B
C
D
E
1
Spend
Sign-ups
R squared
2
1
12
3
2
15
4
3
19
Percent explained
5
4
20
6
5
26
7
6
27
8
9

Common mistakes

  • RSQ ignores direction. A strongly falling relationship scores as high as a strongly rising one.
  • A high value does not prove cause and effect, and it says nothing outside the range of data you measured.
  • Ranges of different sizes return #N/A, and a series with no variation returns #DIV/0!.
  • A few extreme points can push RSQ up or down. Chart the data before you rely on it.

Questions people ask

What is a good R squared value?

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.

What is the difference between RSQ and CORREL?

CORREL returns the correlation coefficient, from -1 to 1, with a sign. RSQ is that number squared, from 0 to 1, with no sign.

Does the order of the arguments matter in RSQ?

No. R squared is the same whichever series you put first, although the convention is known_ys first.

Why does RSQ return #DIV/0!?

One of the series has no variation, for example every value is the same, so there is nothing for a line to explain.

Learn RSQ in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.