Chart & Visualization Issues

Display a Trendline Equation and R-Squared Value in Excel Charts

Phi Hung VoPhi Hung Vo Nov 12, 2026 869 views

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.
Before you start

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.

Solution 1Recommended

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.

1
Select the trendline

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.

2
Open trendline formatting

Right-click the selected trendline and choose Format Trendline to open the trendline options pane.

3
Enable the equation

In the Trendline Options section, select Display Equation on chart.

4
Enable R-squared

Select Display R-squared value on chart. The equation and R-squared value will appear as labels on the chart.

Check the trendline type: For a straight-line relationship, choose Linear. For exponential growth or decay, choose Exponential so the displayed equation reflects the intended model.

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. 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. 2. Add a trendline: Select the chart, open the chart editing tools, and choose the Trendline option for the appropriate data series.
  3. 3. Open Format Trendline: Right-click the trendline and select Format Trendline to open its options.
  4. 4. Display both values: In Trendline Options, select Display Equation on chart and Display R-squared value on chart.
Display trendline equations and R-squared values directly on charts.Use LINEST or LOGEST for worksheet-based regression calculations.Work with familiar spreadsheet tools and a lightweight chart-editing workflow.Open and save Microsoft Excel .xlsx files with broad format compatibility.
microsoft office alternative - wps office

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.