Why Excel LINEST, RSQ, and Trendline R-Squared Values Differ
Question details
Understand the mathematical discrepancy between Excel's LINEST function, RSQ function, and chart trendline R-squared values during regression analysis.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Performing statistical regression analysis and comparing R-squared results from different Excel functions and chart trendlines.
- Observed behavior
- R-squared values generated by LINEST, RSQ, and chart trendlines do not match, particularly when the regression intercept is forced to zero.
Verify whether your statistical model strictly requires a forced zero intercept (regression through the origin) before comparing the R-squared values across different functions.
Understand the Difference in Sum of Squares Calculations
Learn how Excel calculates Total Sum of Squares (SStot) differently depending on the function and the intercept settings.
The primary reason for differing R-squared values lies in the definition of the Total Sum of Squares. When an intercept is forced to zero, LINEST uses an uncentered sum of squares. However, the chart trendline may continue to use a centered definition, causing a mismatch in the reported R-squared value.
Recognize that for a zero-intercept regression, LINEST effectively calculates R-squared using the uncentered total: 1 - SUMXMY2(y, predictedY) / SUMSQ(y).
For a regression with a nonzero (estimated) intercept, LINEST uses the centered total sum of squares: 1 - SUMXMY2(y, predictedY) / SUMPRODUCT((y - AVERAGE(y))^2).
Note that the Excel chart trendline often defaults to the centered definition of SStot even when the intercept is forced to zero, which leads to the legitimately different R-squared values you observe.

Configure the Trendline Intercept Setting
Ensure your chart trendline settings align with the assumptions used in your RSQ or LINEST functions.
Use WPS Spreadsheet for Reliable Regression Analysis
WPS Spreadsheet provides comprehensive statistical functions, including LINEST and RSQ, and supports advanced chart trendline formatting. It handles complex data seamlessly, giving you reliable regression outputs for your professional or academic research.
- 1. Prepare your data: Open WPS Spreadsheet, enter your independent (X) and dependent (Y) variables in separate columns.
- 2. Insert a chart: Highlight your data, navigate to the Insert tab, select Scatter Chart, and add a trendline to visualize your data.
- 3. Calculate R-Squared: Use the RSQ or LINEST function in an empty cell to calculate and verify the exact statistical values of your model.

Frequently Asked Questions
What does the RSQ function do?
The RSQ function calculates the square of the Pearson product-moment correlation coefficient for two data sets. By default, it calculates the R-squared value assuming a nonzero intercept.
Why is regression through the origin controversial?
Forcing a regression model to have a zero intercept (passing through the origin) alters how variance is calculated and can artificially inflate or reduce the perceived fit of the model. It is usually only recommended when there is a strict theoretical reason that the dependent variable must be zero when the independent variable is zero.
Can I force the intercept to zero in an Excel chart?
Yes. Right-click the trendline on your chart, select 'Format Trendline', find the Trendline Options pane, check the 'Set Intercept' box, and enter 0 as the value.




