Add a Regression Equation to an Excel Scatter Plot
Question details
The user wants to display a regression equation for the data in an Excel scatter plot.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A scatter plot has been created to visualize the relationship between two variables.
- Observed behavior
- The chart does not display a trendline equation.
Check that the scatter plot uses the intended numeric X and Y values. If the chart has multiple data series, identify the series for which you want a regression equation.
Display the trendline equation on the scatter plot
Use a chart trendline to show the regression equation alongside the plotted data.
Click a data point in the Excel scatter plot to select the series, then right-click it.
Select Add Trendline and choose a model, such as Linear, in the Format Trendline pane.
In the Format Trendline pane, select Display Equation on chart. Select Display R-squared value on chart as well if you want to see the fit statistic.

Calculate linear regression coefficients in worksheet cells
Use worksheet functions when you need the slope and intercept for calculations rather than only a chart label.
Show a Regression Equation in WPS Spreadsheets
Open your spreadsheet in WPS Spreadsheets, add a trendline to the scatter plot, and display its equation on the chart.
- 1. Open the workbook: Open WPS Spreadsheets and use File > Open to select your workbook.
- 2. Select the plotted series: Click a data point in the scatter plot, then right-click the selected series.
- 3. Add a trendline: Choose Add Trendline and select Linear or another model suited to your data.
- 4. Display the equation: In the trendline options, select Display Equation on chart. If needed, also select Display R-squared value on chart.

Frequently Asked Questions
How do I show the R-squared value on an Excel scatter plot?
Right-click the data series, select Add Trendline, and check Display R-squared value on chart in the Format Trendline pane.
How can I get the regression slope and intercept in cells?
Use =SLOPE(y_range,x_range) for the slope and =INTERCEPT(y_range,x_range) for the intercept. Replace the ranges with your worksheet's corresponding Y and X values.
Can I add equations for more than one data series?
Yes. Right-click each data series separately, choose Add Trendline, and enable Display Equation on chart for each trendline.
Why do calculations using the displayed equation differ slightly from the trendline?
The chart label may round its coefficients. Use SLOPE and INTERCEPT in worksheet cells for more precise linear calculations, or format the equation label to display more decimal places.




