In Excel for Microsoft 365 on Windows, select the chart, choose Chart Design > Add Chart Element > Trendline > More Trendline Options, then select Display Equation on chart and, if wanted, Display R-squared value on chart. Excel uses these options for a trendline’s equation and fit statistic; ordinary data labels on the chart instead label individual data points.
What Excel means by a trendline data label
The phrase trendline data label can mean two different things. Most often, people want the equation for a fitted line, such as y = 2x + 1, or the R-squared value that Excel calculates for that trendline. These appear as text on the chart when you turn on the corresponding options in the Format Trendline pane. They are not the same as labels showing the value of each plotted point.
Excel’s standard trendline controls do not create a separate automatic label for every position along the trendline. A trendline summarizes a pattern across a data series; it is not a series of measured observations. If you need a value at each x-position, create a calculated series and label those points. If you only need to explain the fitted pattern, displaying the equation is usually the simpler choice.
Add an equation or R-squared label
First create or select a supported chart. For a relationship between two numeric variables, an XY (Scatter) chart is often the clearest choice because it uses the actual x-values. Then add a trendline and turn on the labels:
- Select the chart. If it has multiple data series, select the series that the trendline should describe.
- On the ribbon, choose Chart Design > Add Chart Element > Trendline, then select More Trendline Options. You can also use the chart’s plus-shaped Chart Elements button, select Trendline, and open its additional options.
- In the Format Trendline pane, choose the appropriate trendline type, such as Linear.
- Under the trendline options, select Display Equation on chart. Select Display R-squared value on chart as well if you want the fit statistic.
- Move the displayed text if it covers data, the legend, or another chart element.
The equation and R-squared value are independent options: you can show either one or both. The equation is calculated from the series used by that trendline, so check that you selected the intended series before interpreting it. Menu names and pane placement can shift slightly between Excel updates, but the options are in the trendline’s formatting controls.
Choose the right chart and trendline type
Trendlines are most informative when the chart represents the data appropriately. An XY (Scatter) chart is a strong default when both variables are numeric—for example, advertising spend on the horizontal axis and sales on the vertical axis. A line chart treats its horizontal axis as categories or equally spaced positions, which can misrepresent data when x-values are unevenly spaced. If time intervals are irregular, a scatter chart with dates or numeric time values may better reflect the spacing.
Excel offers several trendline models. The model should follow a plausible pattern in the data, not merely produce an attractive R-squared value.
- Linear: Describes a straight-line relationship. Its equation has a slope and an intercept.
- Exponential: Models a curve that changes at a rate related to its current value. It requires positive y-values.
- Logarithmic: Models a pattern that rises or falls quickly and then levels off. It requires positive x-values.
- Polynomial: Models a curve with bends. You can choose its order; higher orders can follow local fluctuations and may overfit.
- Power: Models a relationship based on powers of x and requires positive x- and y-values.
- Moving Average: Smooths short-term fluctuations over a chosen number of points. It does not display an equation in the same way as a fitted equation-based model.
Excel does not support trendlines for every chart configuration. If the Trendline option is unavailable, check whether the chart is a supported two-dimensional chart and whether the selected series is suitable. A pie chart, a three-dimensional chart, or a stacked chart is not a good basis for a standard trendline. Converting the data to an XY scatter chart can resolve many cases.
Read the equation and R-squared value correctly
For a linear trendline, the displayed equation is commonly written as y = mx + b. Here, m is the slope, or estimated change in y for a one-unit increase in x, and b is the estimated y-value when x is zero. For example, if the chart shows y = 2x + 1, the fitted value at x = 5 is 11. That describes the model’s estimate, not necessarily an actual observation in the source data.
R-squared indicates how closely the model’s values correspond to the observed values in the fitted series. A value nearer 1 generally indicates a closer fit for that model and dataset. It does not prove that x causes y, establish that the model is appropriate, or guarantee that predictions beyond the observed range will be accurate. A complicated polynomial can achieve a high R-squared while behaving poorly outside the data range. Consider the chart, the data, and the reason for fitting a trendline rather than judging the model by one statistic.
Excel may round the equation printed on the chart. A displayed slope such as 2.1 can therefore produce slightly different results from the underlying calculation, especially when values are large or precise. Treat the label as a readable summary, not necessarily a full-precision calculation record.
Format and position the label
Click the equation or R-squared text to select it, then use the Home ribbon’s font controls to adjust its font, size, color, or emphasis. Drag the selected text to a clearer place in the chart area. If the text is difficult to select, click once near it and check that the equation label—not the trendline or plot area—is selected. A second click may be needed when the chart contains several selectable elements.
For more precise number formatting, right-click the equation label and choose Format Trendline Label if that command is available in your Excel build. In the formatting pane, look for Number settings and adjust the displayed decimal places or number format. The equation’s displayed precision is separate from the precision stored in the worksheet data. Avoid rounding so aggressively that the printed slope or intercept becomes misleading.
Keep labels readable at the chart’s final size. A label that looks clear while editing may become tiny when the chart is pasted into a report. Increase the chart size or place the label in an area with open space rather than shrinking the font excessively. If equation and R-squared text overlap, move one label or make the chart wider.
Show labels for values along the trendline
If your goal is to display calculated trend values for individual x-values, create a helper column and plot it as another data series. For example, suppose A2:A6 contains x-values 1, 2, 3, 4, and 5, while B2:B6 contains y-values 3, 5, 7, 9, and 11. With this layout, enter =FORECAST.LINEAR(A2,$B$2:$B$6,$A$2:$A$6) in C2 and fill it down through C6. The first result is 3, and the five predicted values are 3, 5, 7, 9, and 11 because these example points lie exactly on y = 2x + 1.
Add the x-values in column A and the calculated values in column C as a new series on the chart. In Excel, select the chart and use Chart Design > Select Data to add or edit a series; use the x-values for the series’ horizontal values and the helper column for its y-values. Once the new series is plotted, select that series and choose Chart Design > Add Chart Element > Data Labels to show labels for its points. The exact series-editing dialog can differ by chart type.
This approach labels calculated points, not every possible point on a continuous trendline. It is useful when a report needs predicted values at specific dates, quantities, or other x-values. If you only want the fitted equation printed once, use Display Equation on chart instead; a helper series adds data and visual detail that may not be necessary.
Common problems and practical fixes
- Data Labels does not show the equation: Data Labels labels series points. Open the Format Trendline pane and enable Display Equation on chart for the equation.
- The equation is missing: Confirm that the trendline is selected and that the equation checkbox is enabled. Also check that the chart type and series support a trendline.
- The equation appears on the wrong data: A chart can contain multiple series. Remove the unintended trendline and add one to the correct series.
- The trendline looks wrong: Check whether the chart’s x-axis is numeric and whether the chosen model makes sense. A category-based line chart can space irregular x-values evenly.
- The equation does not match a manual calculation: Check the selected series, trendline type, and rounding of the displayed equation. A nonlinear model will not follow the same equation as a straight-line calculation.
- The label overlaps the data: Drag it to an open area, resize the chart, or simplify other chart elements. Do not hide important points just to preserve the label’s default position.
Excel for Mac and Excel for the web
In Excel for Mac, select the chart and use the Chart Design tab’s Add Chart Element controls to add a trendline, then open its formatting options and enable the equation or R-squared display. Ribbon labels and pane layout can vary somewhat by release, but the options serve the same purpose. If you do not see the same button arrangement as on Windows, select the trendline and look for its formatting pane.
Excel for the web may present fewer chart-formatting controls than the Microsoft 365 desktop app, and available options can change as the web version is updated. If you cannot find the equation or R-squared settings in the browser, open the workbook in the desktop app and use the trendline formatting steps above. The chart can then be saved and viewed in the browser.
Frequently Asked Questions
How do I add an equation to a trendline in Excel?
Select the chart and its data series, open Chart Design > Add Chart Element > Trendline > More Trendline Options, and select Display Equation on chart.
How do I show R-squared on an Excel chart?
Open the Format Trendline pane for the relevant series and select Display R-squared value on chart. Excel displays the value as a chart label.
Why does adding data labels not show my trendline equation?
Data Labels applies to points in a data series. The equation has its own setting in the trendline options, so turn on Display Equation on chart instead.
Can I put labels on every point of a trendline?
Not as automatic labels on the trendline itself. Create a helper series of calculated values, add that series to the chart, and apply Data Labels to its points.
Does a high R-squared prove the trendline is accurate?
No. It describes fit to the data used to create the model, but does not establish causation or guarantee future accuracy. Check the model type and avoid assuming it remains valid beyond the observed range.
Related
- Excel Split Cell Into Multiple Cells: Methods That Work
- Excel Split Names in One Cell Into Two Cells
- Excel Split One Cell Into Multiple Rows: How It Works
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- How to Zoom In on a Scatter Plot in Excel: Axis ScalingTo zoom in on a scatter plot in Excel, change the horizontal (X) and vertical (Y) axis bounds…
- Advanced Gantt Chart Excel Formula: Build a Dynamic PlanAn advanced Gantt chart in Excel is usually built with a date-based conditional-formatting formula, not a single formula…
- Excel Gantt Charts: How to Skip Weekends and HolidaysYes. In Excel for Microsoft 365, you can make a Gantt schedule skip weekends by building its timeline…
- How to Make a Pie Chart in ExcelTo make a pie chart in Microsoft Excel for Microsoft 365 on Windows, arrange category names in one…
- How to Flip an Axis in an Excel Chart: Step-by-Step GuideTo flip an axis in an Excel chart, select the axis, right-click it, choose Format Axis, and turn…
- Excel Pivot Table Calculated Field Filter ExplainedYes, you can filter a PivotTable based on a calculated field’s results, but usually you do it with…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.