Create an Automatically Updating Trendline and Equation in Excel
Question details
Create an Excel chart with a regression trendline and equation that update when source data changes.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to chart X and Y values using a dynamic data range and display an appropriate regression curve.
- Observed behavior
- The chart should include new or edited data and recalculate the displayed trendline equation automatically.
Arrange numeric X and Y values in two columns with headers. Decide which regression type suits the data; for example, an exponential trendline requires positive Y values.
Create a Trendline from an Excel Table
Use an Excel Table to expand the chart's source data as you add rows, then display the regression equation on the chart.
Select the X and Y columns, including their headers, and choose Insert > Table. Confirm that My table has headers is selected, then click OK.
Select the table's X and Y columns and choose Insert > Scatter (X, Y). Choose a scatter chart style.
Click a data point in the chart, right-click the series, and choose Add Trendline. In Format Trendline, select Linear, Exponential, Polynomial, or another type appropriate for your data.
In Format Trendline, select Display Equation on chart and, if useful, Display R-squared value on chart.
Edit a table value or enter a new X and Y pair directly below the table. Check that the chart includes the point and updates the trendline and equation. If it does not, use Chart Design > Select Data to check the series' X and Y ranges.

Build an Updating Trendline Chart in WPS Spreadsheet
Use an XY scatter chart in WPS Spreadsheet to plot your data and display a fitted trendline equation. Reserve blank rows in the chart range so you can add data without changing the range each time.
- 1. Prepare the data range: Open the workbook in WPS Spreadsheet and arrange numeric X and Y values in adjacent columns. Include a reasonable number of blank rows below the data in the range you select.
- 2. Insert a scatter chart: With the data and reserved blank rows selected, choose Insert > Chart and select an XY scatter chart.
- 3. Add the regression curve: Right-click the chart's data series and choose Add Trendline. Select a suitable trendline type and enable the option to display the equation on the chart.
- 4. Add and check data: Enter new X and Y values in the reserved rows and check that the chart and equation update. If you run out of reserved rows, use the chart's Select Data option to extend the source range.

Frequently Asked Questions
Why didn't my Excel chart include a new row?
Enter the new values directly below the Excel Table so it expands. Then use Chart Design > Select Data to check that the series references the table's X and Y columns.
How do I display the R-squared value?
Right-click the trendline, choose Format Trendline, and select Display R-squared value on chart.
Which trendline type should I choose?
Choose a type that fits the relationship in your data. Use Linear for an approximately straight-line relationship, or consider Polynomial for a curved relationship. Exponential trendlines require positive Y values.
Why does the equation appear rounded?
Excel can display rounded coefficients even though the trendline uses more precision. Right-click the equation, choose Format Trendline Label, and increase the displayed decimal places under Number.




