Display a Trendline Equation and R-Squared Value in Excel Charts
Question details
The user needs to display a chart trendline equation and coefficient of determination, or R-squared value.
- Product
- Microsoft Excel / WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- A chart already contains a trendline, and the user wants the regression equation and R-squared value visible on the chart or calculated in worksheet cells.
- Observed behavior
- The trendline is shown without its equation or R-squared value.
Make sure the chart contains the correct data series and that a trendline has already been added. For the most meaningful R-squared result, verify that the selected trendline type matches the data pattern.
Show the trendline equation and R-squared value directly on the chart
Use this method when you want both regression values displayed as chart labels.
The chart's trendline formatting options control whether the fitted equation and coefficient of determination appear on the chart. The available equation depends on the selected trendline type, such as linear or exponential.
Click the chart, then click the trendline to select it. If the chart does not have one, use the chart's Add Chart Element or Trendline command to add a trendline first.
Right-click the selected trendline and choose Format Trendline to open the trendline options pane.
In the Trendline Options section, select Display Equation on chart.
Select Display R-squared value on chart. The equation and R-squared value will appear as labels on the chart.
Calculate trendline values in worksheet cells
Use worksheet formulas when you need reusable regression results outside the chart.
Create Chart Trendline Equations in WPS Spreadsheet
WPS Spreadsheet lets you add a trendline to a chart, open Format Trendline, and display the equation and R-squared value without leaving the chart. It also supports worksheet-based regression calculations for reusable analysis.
- 1. Insert or select a chart: Open the worksheet in WPS Spreadsheet and select the data range, then choose Insert > Chart or click an existing chart.
- 2. Add a trendline: Select the chart, open the chart editing tools, and choose the Trendline option for the appropriate data series.
- 3. Open Format Trendline: Right-click the trendline and select Format Trendline to open its options.
- 4. Display both values: In Trendline Options, select Display Equation on chart and Display R-squared value on chart.

Frequently Asked Questions
Where can I turn on the trendline equation in Excel?
Right-click the trendline, choose Format Trendline, and select Display Equation on chart under Trendline Options.
How do I show the R-squared value on a chart?
Open Format Trendline for the chart's trendline and enable Display R-squared value on chart. The value will appear beside the trendline equation.
Which function calculates a linear trendline in worksheet cells?
Use LINEST with the known y-values and x-values, for example =LINEST(B2:B10,A2:A10,TRUE,TRUE).
What function should I use for an exponential trendline?
Use LOGEST with the known y-values and x-values, for example =LOGEST(B2:B10,A2:A10,TRUE,TRUE).
Why is the displayed equation different from the formula I expected?
Check the selected trendline type and the data series. A Linear trendline produces a straight-line equation, while an Exponential trendline uses a different model and equation format.




