Show a Formula in an Excel Graph: Trendline or Series

Charts & pivot tables · Updated November 18, 2026

To show an equation on an Excel graph, select the chart, add a trendline, open its formatting options, and check Display Equation on chart. Excel will place the fitted equation on the graph. If you mean a worksheet formula that calculates the plotted values, calculate those values in cells first, then chart them; the trendline equation and the cell formula are different things.

What You’ll Need

  • Excel for Microsoft 365 on Windows and a worksheet containing numeric data.
  • A chart with a data series, preferably an XY (Scatter) chart when you want an equation showing how a measured value changes with another numeric value.
  • For a chart that displays a custom label instead of a fitted trendline, a worksheet cell containing the label you want to show.

The steps below cover both common meanings of “show formula”: displaying Excel’s trendline equation and showing a formula or formula result associated with your chart. The equation from a trendline estimates the relationship represented by the plotted data; it does not reveal the formula used in your worksheet cells.

Step-by-Step

  1. Check the data you plan to plot. Put the independent, numeric values—such as time, distance, or temperature—in one column, and the values you want to explain in another. Include clear column headings, but keep headings out of the numeric data range if you select the range manually. A trendline fits the points in a chart series, so confirm that the series contains the right observations and does not accidentally include totals or blank rows.
  2. Create or select a suitable chart. Select the two columns, then choose Insert > Insert Scatter (X, Y) or Bubble Chart and select a scatter option. An XY scatter chart treats the first column as numeric x-values and the second as y-values, which makes it a good choice for a mathematical relationship. If you already have a chart, click it and inspect the series. A line chart can be appropriate when the horizontal axis represents categories or evenly spaced dates, but it may treat those labels differently from numeric x-values.
  3. Add a trendline to the right series. Click a data point in the series that needs an equation. Check that the whole series is selected, rather than just one point. On the ribbon, choose Chart Design > Add Chart Element > Trendline > More Trendline Options. You can also use the chart’s plus button, choose Trendline, and open its additional options. If your chart contains several series, select the intended series before adding the line so Excel does not fit the wrong data.
  4. Choose a trendline type that suits the pattern. In the Format Trendline pane, select a type such as Linear, Exponential, Logarithmic, Polynomial, or Power. Linear is a sensible starting point when the points follow an approximately straight pattern. For a polynomial trendline, choose an order only when the curve is justified by the data; a higher order can follow small fluctuations and make the equation misleading. Excel cannot fit every trendline type to every data set: for example, logarithmic and power fits have restrictions on the values they can use.
  5. Turn on the equation label. In the Format Trendline pane, under Trendline Options, select Display Equation on chart. Excel adds the fitted equation as a label on the graph. You can also select Display R-squared value on chart if you want that statistic shown. R-squared is a measure of how closely the fitted line represents the data in that chart; it is not proof that the chosen model is suitable or that one variable causes another.
  6. Make the equation readable. Click the equation label and drag it to an open area of the chart. Resize the chart or reposition the legend if the label overlaps points, axis labels, or other information. With the label selected, use the formatting options on the ribbon to adjust font size, color, or number formatting where available. Keep enough decimal places to make the displayed equation useful, but do not imply greater precision than the data supports.
  7. Check what the equation represents. Compare the plotted points with the selected trendline and read the equation carefully. For a linear fit, an equation is commonly displayed in the form y = mx + b: m is the slope and b is the y-intercept. The coefficients come from the chart’s fitted data and may be rounded in the label. If you need more precision, use the trendline for visual explanation and calculate or document the required values separately rather than relying on a rounded chart label.
  8. If you meant a worksheet calculation, chart the calculated cells. For example, with source values in B2:B6 and a 10% increase to apply in a new series, enter this in C2 and fill it down through C6: =B2*1.1. If B2 contains 100, C2 returns 110. Add column C as a chart series using Chart Design > Select Data > Add, then set the series name and values. This plots the formula results; it does not put the text of each underlying cell formula on the graph.
  9. Show custom formula text as a chart label if needed. If the goal is to display a particular formula or explanation rather than a fitted trendline, enter the desired text in a worksheet cell. With that label stored as text in Sheet1!D2, insert a text box on the chart, select the text box, click the formula bar, enter =Sheet1!$D$2, and press Enter. The text box will show the linked cell’s contents and update when that cell changes. If your worksheet has a different name, use that name in the reference; sheet names containing spaces need single quotation marks around the name.

On Mac, the chart and trendline controls are also available when a chart is selected, though ribbon organization and pane layout can differ slightly. Excel for the web may show charts created in desktop Excel, but some chart editing controls can be limited; open the workbook in the desktop app if you cannot find the trendline equation option.

Common Mistakes

  • Confusing a fitted equation with a cell formula. A trendline equation is calculated from chart data. It does not show the formula that produced a value in a worksheet. To show the actual calculation, chart its results or link a custom text box to a cell.
  • Using the wrong chart type or series. A category-based line chart may not use numeric x-values as expected. A chart with multiple series can also receive a trendline on the wrong set of points. Use a scatter chart for two numeric variables and verify the selected series.
  • Choosing a trendline only because it looks close. A complex polynomial can create a dramatic curve without explaining the underlying pattern. Check whether the fit makes sense, use suitable data, and avoid treating a high R-squared value as a guarantee of a reliable model.
  • Expecting a trendline for unsuitable data. Trendline types have data requirements. Logarithmic or power trendlines, for instance, may not work with zero or negative values. Choose a valid model or review the source data rather than changing values just to force a line.
  • Leaving the equation hidden behind another chart item. The label can be present but obscured by the legend, data points, or chart edge. Move it and check the chart at its final size, especially before printing or pasting it into a report.

Tips

  • Give the axes clear titles and units. An equation is easier to interpret when readers know what x and y measure.
  • Use Display R-squared value on chart only when it adds context. Explain what the statistic means for your analysis rather than presenting it as a quality stamp.
  • For a trendline label, click and drag it to reposition it. For a custom label that must stay current, link a chart text box to a cell instead of typing the same text directly on the chart.
  • Keep the source data and the chart together in the workbook. If values change, confirm that the chart’s series range includes new rows and that the trendline still fits the intended observations.
  • When you need a coefficient for further calculations, avoid copying rounded numbers from the chart label. Keep a documented calculation in the worksheet and make clear which data and model it uses.

Troubleshooting

The equation checkbox is missing: Select the trendline itself and open the Format Trendline pane, not the chart area or a data point. If no trendline exists, add one to a data series first. Some trendline types, such as a moving average, do not provide a standard equation label because they do not use the same fitted-equation form.

The equation does not appear after checking the option: Click elsewhere on the chart and look for the label. It may be outside the visible plot area or underneath another object. Enlarge the chart, move the legend, or select and drag the equation. If it still does not appear, remove the trendline and add it again to the intended series.

The equation or curve looks wrong: Confirm that the x- and y-values are assigned to the right columns and that the series contains only the intended data. Check for text values, blanks, unintended zeros, or outliers. Try a scatter chart if the horizontal values are numeric. A different trendline type can change the equation substantially, so select one for a reason rather than switching models just to obtain a preferred result.

A linked text box shows an error or the wrong content: Confirm that the reference points to the correct worksheet and cell, and that the target cell contains the label you expect. If the sheet name includes spaces, enclose it in single quotation marks in the reference. Select the text box before entering the reference in the formula bar; otherwise, you may replace a worksheet cell instead.

Frequently Asked Questions

Can Excel show the equation of a graph automatically?
Yes. Add a trendline to a chart series, then select Display Equation on chart in the Format Trendline pane. The equation is a fit to the plotted data.

Does the trendline equation show the formula in my worksheet?
No. It describes a trend fitted to chart data. To display a worksheet formula’s result, chart the cells that calculate it. To display custom formula text, put the text in a cell and link a chart text box to that cell.

Why does my trendline equation differ from my expected formula?
Excel calculates a fit from the selected points, and the result depends on the chart series, trendline type, and displayed rounding. Check the data range and model, and remember that the chart label may round its coefficients.

Can I show both the equation and R-squared?
Yes. In the Format Trendline pane, select both Display Equation on chart and Display R-squared value on chart. Move the labels if they overlap or make the chart difficult to read.

Can I show the equation on a chart in Excel for the web?
Availability of chart editing options can vary. If the web app does not offer the trendline or equation control, open the workbook in Excel for Microsoft 365 on Windows or Mac, add the label there, and save the workbook.

Related

Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.

More in Charts & pivot tables

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.