Why Excel LINEST and Trendline R-Squared Values Differ
Question details
Understand why Excel LINEST and a chart trendline may report different R-squared values for regression through the origin.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user fits a linear regression with the intercept fixed at zero using both LINEST and a chart trendline.
- Observed behavior
- The R-squared values reported by LINEST and the chart trendline can differ when the regression is forced through the origin.
Identify the X and Y data ranges and check that both calculations use the same numeric observations. In the chart's Format Trendline pane, confirm that the linear trendline's intercept is set to zero.
Compare the Slope and R-Squared Calculations
Use matching data and formulas to distinguish a difference in the fitted line from a difference in R-squared conventions.
Regression through the origin does not have the same R-squared interpretation as regression with an estimated intercept. A calculation may use either an uncentered total sum of squares or a total centered on the mean of Y.
The examples below assume X values are in A2:A10 and Y values are in B2:B10. Replace those ranges with your own matching data ranges.
Select the chart trendline, open Format Trendline, and choose Linear. Set the intercept to 0, then select Display Equation on chart and Display R-squared value on chart.
In an empty cell, enter =LINEST(B2:B10,A2:A10,FALSE,TRUE). To return its R-squared value directly, enter =INDEX(LINEST(B2:B10,A2:A10,FALSE,TRUE),3,1) in another cell.
Enter =SUMPRODUCT(A2:A10,B2:B10)/SUMSQ(A2:A10) in D2 for the zero-intercept slope. In D3, enter =SUMPRODUCT((B2:B10-D2*A2:A10)^2) to calculate the residual sum of squares.
Enter =1-D3/SUMSQ(B2:B10) for an uncentered R-squared value and =1-D3/DEVSQ(B2:B10) for a centered calculation. Compare these results with LINEST and the trendline, allowing for rounding in the chart label.

Fit a Regression With an Estimated Intercept
Use an estimated intercept when the model does not require the line to pass through zero.
Analyze Regression Data in WPS Spreadsheet
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format compatibility. Open existing Excel workbooks and continue working with regression data without starting over. It does not change how Microsoft Excel calculates trendline values.

Frequently Asked Questions
Why does fixing the intercept at zero affect R-squared?
A zero-intercept regression uses a different model from one with an estimated intercept. R-squared can also be calculated using a total sum of squares measured from zero or from the mean of Y, leading to different interpretations.
How do I return R-squared from LINEST?
For Y values in B2:B10 and X values in A2:A10, enter =INDEX(LINEST(B2:B10,A2:A10,FALSE,TRUE),3,1). FALSE fixes the intercept at zero, and TRUE requests regression statistics.
Where can I set a chart trendline's intercept to zero?
Select the chart trendline and open Format Trendline. Under the linear trendline options, select Set Intercept and enter 0.
Can a centered R-squared value be negative?
Yes. For a regression forced through zero, the residual sum of squares can exceed the total sum of squares centered on the mean of Y, making 1 minus their ratio negative.




