RSQ Function
Returns R², the share of variation explained by a straight-line fit.
Category
Statistical
Available in
All versions, Microsoft 365
Returns
A number from 0 to 1
Overview
RSQ returns the square of the Pearson correlation. Read it as "the share of the ups and downs in y that the straight line through x explains": 0.85 means 85%.
It's the R² Excel shows on a chart trendline. Note the order: known y's first, then known x's (for RSQ itself the order doesn't change the answer).
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| known_y's | Yes | The values you want to explain (for example, sales). |
| known_x's | Yes | The values that explain them (for example, ad spend), the same size. |
Examples
Example 1 — How much does ad spend explain?
Sales in C, ad spend in B.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Month | Ad spend ($k) | Sales ($k) | Measure | Result |
| 2 | Jan | 2 | 21 | R² | 0.9850 |
| 3 | Feb | 3 | 25 | ||
| 4 | Mar | 5 | 33 | ||
| 5 | Apr | 4 | 28 | ||
| 6 | May | 6 | 38 | ||
| 7 | Jun | 7 | 40 | ||
| 8 | Jul | 8 | 46 | ||
| 9 | Aug | 5 | 31 |
About 98.5% of the month-to-month variation in sales lines up with ad spend.
Common mistakes
- High R² isn't proof. Like correlation, a high R² doesn't show cause and effect — and with few points it can be high by chance.
- #DIV/0! One range has no spread, or there are fewer than two pairs.
- #N/A The ranges are different sizes.
Notes
- LINEST with stats = TRUE returns R² too, along with the slope, intercept and standard errors.
- Related functions: CORREL, SLOPE, INTERCEPT, STEYX, LINEST.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.