Function Problems

Why Excel LINEST and Trendline R-Squared Values Differ

Adam DavisAdam Davis Nov 14, 2026 869 views

Question details

Understand why Excel LINEST and a chart trendline may report different R-squared values for regression through the origin.

Why Excel LINEST and Trendline R-Squared Values Differ
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.
Before you start

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.

Solution 1Recommended

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.

1
Check the trendline settings

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.

2
Calculate the LINEST results

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.

3
Calculate the slope and residuals

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.

4
Compare R-squared definitions

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.

Compare the Slope and R-Squared Calculations
Interpret the results carefully: A centered R-squared calculation can be negative for a model forced through zero. The formulas require nonzero denominators, and the appropriate definition depends on the analysis.
Free Microsoft Office alternative

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.

Work with regression data and spreadsheet formulas in WPS SpreadsheetOpen and save Microsoft Excel formats, including XLSXUse a familiar interface for a smoother move from ExcelAccess a free, lightweight office suite
microsoft office alternative - wps office

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.