R-Squared: How Well a Line Fits

Excel Formulas › Statistics

All versionsRSQ

R-squared says how much of the variation in y is explained by x — from 0 (no relationship) to 1 (a perfect line). It’s the headline number for any trend or regression.


Quick formula: R-squared for y (B) on x (A):
=RSQ(B2:B100, A2:A100)
It’s the square of the correlation: RSQ = CORREL^2. 0.85 means x explains 85% of y’s variation.

Functions used (tap for the full reference guide):

The example

The fit quality of a trend.

AB
1MeasureValue
2Correlation0.92
3R-squared0.85

The formula

The formula:

=RSQ(ys, xs) // share of variation explained

How it works

How it works:

  1. RSQ(known_ys, known_xs) returns a value from 0 to 1.
  2. It equals the square of the correlation: RSQ = CORREL(ys,xs)^2.
  3. Read it as a percentage: 0.85 means the line explains 85% of the variation in y.
  4. Higher is a tighter fit — but a high R-squared doesn’t prove causation, only association.

High R-squared ≠ good model. It can be inflated by outliers, a curved relationship forced into a line, or coincidental correlation. Always look at a scatter plot alongside the number.

Try it: interactive demo

Live demo

Pairs “x,y”.

Variations

From correlation

Square it:

=CORREL(ys,xs)^2

Percent form

As a %:

=RSQ(ys,xs)*100&"%"

Adjusted R²

From LINEST stats.

Pitfalls & errors

Not causation. R-squared measures fit, not cause — correlated isn’t the same as causal.

Outliers inflate it. A couple of extreme points can prop up R-squared; check the scatter.

Linear only. RSQ measures linear fit; a strong curve can show low R-squared.

Practice workbook

📊
Download the free R-Squared: How Well a Line Fits practice workbook
An R-squared sheet with the correlation, percent, and adjusted notes, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I calculate R-squared in Excel?
Use =RSQ(known_ys, known_xs). It returns 0 to 1 — the share of y's variation explained by x. It equals CORREL squared.
What is a good R-squared value?
It depends on the field; closer to 1 is a tighter fit. But always check a scatter plot, since outliers and curves can mislead.
Does a high R-squared prove x causes y?
No — it measures association and fit, not causation.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Correlation · Slope & intercept · Linear forecast

Function references: RSQ · CORREL