Written and maintained by CASRAI Editorial Board
Last updated
Short answer: select the chart, open the chart elements or Chart Design menu, choose Trendline, and pick a type (linear, exponential, logarithmic, polynomial, power or moving average). This guide gives the exact menu paths for Windows, Mac and Excel for the web, then covers what Microsoft’s documentation says about each type, how to show the equation and R², and what to do when the option is missing.
What a trendline is used for in research
A trendline is a fitted line drawn over a data series on a chart. Researchers use it to show the direction of a relationship in a scatter plot, to smooth a noisy time series, or to extend a fitted line a few periods forward or backward. A trendline describes the sample on the chart; it is not a substitute for reporting a fitted model with its uncertainty. For the reporting side, see Linear Regression Scatter Plot: Draw, Read and Report the Line.
Where it works: Windows, Mac and Excel for the web
Trendlines are added to an existing chart, so build the chart first (for two numeric variables, see How Do You Make a Scatter Plot in Excel?). The paths below are those given on Microsoft’s “Add a trend or moving average line to a chart” support page.
| Where you use Excel | Path (per Microsoft Support) |
|---|---|
| Windows desktop | Click the chart (without selecting a data series), select the green plus (Chart Elements) button, then Trendline. In the Add Trendline dialog box, choose the data series options you want and select OK. |
| Mac desktop | On the View menu choose Normal, click the data series you want, open the Chart Design tab, select Add Chart Element, then Trendline. Pick a type or choose More Trendline Options. |
| Excel for the web | Click the chart so the Chart tab appears, go to Format, open the series, and customise the trendline there. A switch shows or hides it. |
Microsoft’s page states that on Windows Excel displays the Trendline option only if you select a chart that has more than one data series, without selecting a data series. On Mac, to remove a trendline, use Add Chart Element, then Trendline, then None, or click the trendline and press Delete.
Step-by-step: add a trendline to a chart
- Create the chart (a scatter plot is the usual choice for a numeric X variable) and click it so the chart tools appear.
- Open the trendline menu using the path for your platform in the table above.
- Select a type. If you are unsure, start with Linear and compare it with the shape of your points (see “Which trendline is best” below).
- If you have several series, choose the series the line should describe. Repeat for each series that needs its own line.
- Open More Trendline Options (or the equivalent trendline options on your platform) to set the polynomial order, moving-average period, forecast distance, intercept, and whether to show the equation and the R-squared value on the chart.
Variants of the same task
- Trendline on a scatter plot: the same steps apply; the chart must exist first.
- Multiple series: each series carries its own trendline, so add one per series.
- Insert or put a trendline in a sheet graph: Excel calls the sheet graph a chart; the steps above are the whole procedure.
- Google Sheets instead: see How to Add a Trendline in Google Sheets.
Which trendline is best?
Choose the type whose shape matches your data, then check the R-squared value. Microsoft’s guidance by type, with the one hard restriction it states for two of them:
| Type | Microsoft’s description | Restriction |
|---|---|---|
| Linear | “A best-fit straight line for simple linear data sets”; data increasing or decreasing at a steady rate | None stated |
| Logarithmic | Curved line for data whose rate of change increases or decreases quickly and then levels out | Can use negative and positive values |
| Polynomial | Useful when data fluctuates; the order can be determined by the number of fluctuations in the data (an order 2 polynomial has only one hill or valley) | VBA: order is an integer from 2 to 6 |
| Power | Data that increases at a specific rate | Cannot be created if the data contains zero or negative values |
| Exponential | Data that rises or falls at constantly increasing rates | Cannot be created if the data contains zero or negative values |
| Moving average | Evens out fluctuations to show a pattern more clearly; the Period option sets how many points are averaged | VBA: period is an integer greater than 1 and less than the number of points |
Microsoft also states that a trendline is most reliable when its R-squared value is at or near 1. That is a reliability statement, not a rule to pick whichever type gives the highest R². A higher-order polynomial will usually raise R² by bending toward noise, so match the type to the process that generated the data and keep the order low.
For a moving average, the number of plotted points equals the number of points in the series minus the period.
How to find the equation of a line in Excel
In the trendline options, tick the option to display the equation on the chart. Excel’s object model names this setting DisplayEquation, and the companion DisplayRSquared shows the R-squared value; both default to False and, when on, appear in the same data label. The equation is a fit for the chart’s X and Y values.
To get the same slope and intercept in cells (where you can copy, round and cite them), use worksheet functions instead of reading them off the label. How to Find a Slope in Excel covers SLOPE, INTERCEPT and LINEST, and TREND Formula in Excel shows how to compute fitted values in cells.
How to find the trend in Excel
Add a trendline of the type that matches the data, then read three things: the shape (is the line close to the points), the sign and size of the slope in the equation, and R². For time series with seasonal noise, a moving average makes the underlying direction easier to see; for a numeric predictor, a linear or curved fit gives a rate of change.
Output and how to read it
- The line: the fitted curve for the chosen type, drawn over the series.
- R-squared: a number from 0 to 1 that reveals how closely the estimated values for the trendline correspond to your actual data (Microsoft’s definition).
- Forecast forward or backward: in the object model, these are set in periods; on a scatter plot they are X-axis units. Extending a line beyond the data is extrapolation and carries more uncertainty than the fit itself.
- Fixed intercept: if you set the intercept (for example to zero) it is fixed; if you omit it, the regression determines it. Microsoft notes that Excel changed how R² is calculated for linear trendlines when the intercept is set to zero, to align with LINEST, so charts made in older versions may show a different R².
For a laboratory use of a fitted line, see Calibration Graph in Excel: Build a Calibration Curve.
Troubleshooting
- No Trendline option (Windows): Microsoft states that Excel displays the Trendline option only if you select a chart that has more than one data series, without selecting a data series. With a single series, or with a series selected, use the Format tab: choose the trendline from the Current Selection dropdown and select Format Selection, or select the series first.
- Power or exponential will not work: the data contains zero or negative values, which Microsoft states rules out these types. Use a linear, logarithmic or polynomial type, or transform the data deliberately.
- Several series: choose the series in the Add Trendline dialog (Windows) or select the series before adding the trendline.
- R² differs from an older workbook: see the zero-intercept note above.
- Moving average rejects the period: the period must be an integer greater than 1 and smaller than the number of data points.
Free alternatives
| Tool | Where to read the steps |
|---|---|
| Google Sheets | How to Add a Trendline in Google Sheets |
FAQ
How to find the equation of a line in Excel?
Turn on the trendline option to display the equation on the chart, or calculate SLOPE and INTERCEPT in cells so you can copy exact values.
How to find the trend in Excel?
Add a trendline matching the data’s shape, then read the line, the slope in the equation and R². A moving average smooths noisy series.
What is the best trendline to use in Excel?
The one whose shape matches your data: linear for steady change, logarithmic for change that levels out, polynomial for data with hills and valleys, and power or exponential only when all values are positive.
How to add a trendline to a sheet graph?
Select the chart and use Chart Elements (Windows), or click the data series and use Chart Design, Add Chart Element (Mac), then choose Trendline and a type.
Sources
- Microsoft Support, Add a trend or moving average line to a chart (checked 2026-11-07).
- Microsoft Support, Trendline options in Office (checked 2026-11-07).
- Microsoft Support, Choosing the best trendline for your data (checked 2026-11-07).
- Microsoft Learn, Trendlines.Add method (Excel) (checked 2026-11-07).







