Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Display Equation on Chart in Excel

· 6 min read · Smart Home

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To display an equation on a chart in Excel, add a trendline to a data series and tick the Display Equation on chart box in the trendline options. The equation appears as a label inside the plot area, showing the line's slope and intercept (or the polynomial, logarithmic or exponential form you chose). This works in Excel for Microsoft 365, Excel 2021, 2019 and 2016 on Windows and Mac; the exact label wording can differ slightly by version and region.

What You'll Need

  • A chart built from numeric data where one series is plotted against another — for example, an XY (Scatter) chart or a Line chart. Trendlines are not available on every chart type.
  • At least two data points in the series (more for curved trendline types).
  • Excel on desktop (Windows or Mac). The full trendline equation option is not available in Excel for the web or the mobile apps; use the desktop app for this.

Step-by-Step

  1. Select the chart. Click once inside the chart area so the Chart Design and Format tabs appear on the ribbon.
  2. Pick the data series. Click directly on one of the data points or the line for the series you want to analyse. If the chart has only one series, clicking the line selects it. If several series overlap, use the Chart Elements button (the green plus sign at the top-right of the chart) and expand Trendline to choose the series by name.
  3. Add a trendline. Open the Chart Elements button (the plus sign) and tick Trendline, or go to Chart Design > Add Chart Element > Trendline and choose the type you need (Linear, Exponential, Linear Forecast, or More Trendline Options for Polynomial, Logarithmic, Power and Moving Average).
  4. Open the trendline formatting pane. With the trendline selected, right-click it and choose Format Trendline. The Format Trendline pane opens on the right.
  5. Tick the equation box. At the bottom of the Trendline Options section, tick Display Equation on chart. The equation label appears near the trendline inside the plot area.
  6. Optionally show R-squared. Tick Display R-squared value on chart to judge how well the line fits the data. A value close to 1 means a strong fit; closer to 0 means the trendline explains little of the variation.
  7. Move and format the label. Click the equation text box and drag it to a clear spot so it does not cover data points. Use the Home tab's font controls to resize or bold it; a white fill and thin border make it readable over gridlines.
  8. Check the numbers. The equation uses the chart's axis scales. If you change the axis minimum, maximum or number format, the displayed coefficients can look different, so confirm the axis settings before you copy the equation elsewhere.

Common Mistakes

  • Using a chart type that does not support trendlines. Stacked charts, 3-D charts, radar charts and pie charts do not offer trendlines. Switch to an XY (Scatter) or Line chart.
  • Selecting the whole chart instead of the series. The trendline is added to whichever series is selected; if you click the chart background, Excel may add it to the wrong series or none at all.
  • Expecting the equation to update the source cells. The equation is a label only. It does not create a formula in your worksheet, and it will not recalculate a predicted value for you.
  • Reading coefficients out of context. The equation is only meaningful if the x-axis is numeric and ordered. On a Line chart with text categories, the x-values are treated as 1, 2, 3 and so on, which changes the slope.
  • Leaving the label over the data. The default position often overlaps points or the legend; drag it to a corner of the plot area.

Tips

  • For a curved relationship, try Polynomial (order 2 or 3) or Logarithmic and compare the R-squared values before settling on a type.
  • Right-click the equation label and choose Format Data Label (or use the Format pane) to change the number format, for example to show more decimal places.
  • If you need the coefficients in cells, read them from the equation and type them into a formula, or use the LINEST function for a linear fit — it returns slope and intercept directly.
  • Keep a copy of the chart before changing axis scales, because the displayed equation changes with the scale.
  • Use a Scatter chart when both variables are numeric; it plots true x-values and gives the most reliable trendline equation.

Troubleshooting

  • The Display Equation option is greyed out. You are probably on a chart type that does not support trendlines, or you have selected the chart area rather than a series. Click a data point and reopen Format Trendline.
  • No equation appears after ticking the box. Close and reopen the Format Trendline pane, or click the trendline again. On some versions the label is placed at the far edge of the plot area and may be hidden behind the legend — drag the legend or resize the plot area.
  • The equation looks wrong. Check the axis scale and whether the x-axis is numeric. Also confirm you added the trendline to the correct series.
  • The option is missing entirely. You may be in Excel for the web or the mobile app, which do not expose the full trendline equation settings. Open the file in the desktop app.
  • Excel is slow or the label will not move. Save and reopen the workbook, then try again; very large data ranges can make chart editing sluggish.

Frequently Asked Questions

Can I display the equation on any chart type?

No. Trendlines and their equations are available on unstacked 2-D chart types such as XY (Scatter), Line, Column, Bar and Area. They are not available on pie, doughnut, radar, stacked or 3-D charts.

Does the equation change when I edit the data?

Yes. The trendline and its equation recalculate automatically when the underlying data changes, provided the chart is linked to the worksheet range.

Can I copy the equation into a cell?

You can retype it, but Excel does not link the label to a cell. For a linear fit, use the LINEST function to get slope and intercept as live values.

Why is my equation different from the one I calculated by hand?

Most often because the chart treats categories as 1, 2, 3 rather than using the real x-values, or because the axis scale has been changed. Use a Scatter chart with numeric x-values and check the axis settings.

Is the equation option available in Excel for the web?

The web version offers limited chart formatting and does not provide the full Display Equation on chart option. Use the desktop app to add and format the equation.

What does R-squared tell me?

It shows how much of the variation in the data the trendline explains, from 0 to 1. A higher value means a better fit, but it does not prove cause and effect.