To add a trendline in Excel for Microsoft 365 on Windows, select a chart, then choose Chart Design > Add Chart Element > Trendline and select a type, such as Linear. To adjust it, choose More Trendline Options; there you can change the model, set a forecast, and display the equation or R-squared value.
What an Excel trendline shows
A trendline is a line or curve drawn over chart data to summarize its overall direction. It can help reveal whether values generally rise, fall, or follow a curved pattern, even when individual observations fluctuate. It is a visual model of the data, not a connection between every point and not proof that one variable causes another.
Excel calculates the trendline from the data series you select. A chart with several series can have a separate trendline for each one. The result depends on the type of model selected and on the data included, so choosing an appropriate chart and trendline matters as much as clicking the command.
Prepare the data and choose a chart
Arrange the data so the values to be plotted are clear: dates or numeric x-values in one column, and the corresponding measurements in another. For example, a table might have Month in column A and Units Sold in column B. Select both columns, then insert a chart using Insert > Recommended Charts or choose a chart type directly from the Insert tab.
For numeric x-values, an XY (Scatter) chart is usually the clearest option. It treats the x-values as actual numbers and spaces points according to their values. A line chart is useful for ordered categories such as months, but its horizontal axis generally spaces categories evenly. If the dates or numeric intervals are irregular, a line chart can therefore give a misleading impression of the spacing; use a scatter chart when the distance between x-values is meaningful.
After inserting the chart, click the data series you want to analyze. If it is difficult to select, click the chart and use the Format tab’s Current Selection list to choose the series. Excel applies a trendline to a data series, not automatically to every series in the chart.
Add a trendline step by step
- Click the chart, then click the series whose pattern you want to summarize.
- On the ribbon, select Chart Design > Add Chart Element > Trendline, then choose a type. Linear is a sensible first choice when you expect a roughly steady increase or decrease.
- To change the type or its settings, choose Chart Design > Add Chart Element > Trendline > More Trendline Options. Excel opens the Format Trendline pane.
- Use the pane to select a model, set options such as a forecast or moving-average period, and, if useful, check Display Equation on chart or Display R-squared value on chart.
You can also use the Chart Elements button (the plus sign beside a selected chart) and check Trendline. Its arrow opens choices for a trendline type and additional options. On Excel for Mac, select the chart and use the Chart Design tab’s Add Chart Element controls; wording and pane placement can vary slightly by version. Excel for the web has chart editing controls too, but available options can differ, so use the desktop app if a particular trendline setting is missing.
Choose the right trendline type
Excel offers several models in the Format Trendline pane. A more complex curve is not automatically a better fit: prefer the simplest model that makes sense for the data and the question you are asking.
- Linear: A straight line that summarizes a roughly constant rate of increase or decrease. It is a useful starting point for many time series and comparisons.
- Exponential: A curve that changes at a rate proportional to its current level, often used for growth or decay that accelerates or slows proportionally. It cannot be calculated when the series contains zero or negative values.
- Logarithmic: A curve that can represent a rapid initial change followed by a slower one. It requires positive x-values; values that do not meet the model’s requirements can prevent Excel from calculating it.
- Polynomial: A curved model that can bend to reflect peaks and valleys. Choose an order from 2 through 6 in the pane. Higher orders can follow more bends, but may fit random variation rather than a durable pattern.
- Power: A curve for relationships in which one variable changes as a power of another. It requires positive x- and y-values.
- Moving Average: A rolling average that smooths short-term variation. Its period controls how many points contribute to each average; a larger period creates more smoothing but can hide short-lived changes.
For instance, monthly sales that rise by a similar number of units each month may be reasonably summarized by a linear trendline. Sales that grow by a similar percentage each month may be better described by an exponential model. These are clues, not rules: inspect the plotted points and consider how the measurements were generated before selecting a model.
Format the line and display its equation
With the trendline selected, open Format Trendline to change its options. To make it easier to distinguish from the data, select the paint-bucket options in the Format Trendline pane and adjust the line’s color, width, or dash style. Keep the line visually distinct without making it so prominent that readers mistake it for observed data.
Checking Display Equation on chart adds the model’s equation to the chart. A linear trendline is shown in the form y = mx + b: m is the slope and b is the intercept. If the chart uses time or another meaningful x-value, the slope describes the model’s change in y for a one-unit increase in x. The units depend on the data; for example, a slope of 12 on a chart of monthly units represents a modeled increase of 12 units per month.
Excel may round the displayed coefficients, so the printed equation can give slightly different results from calculations based on the full-precision values. Right-click the equation label to format it, or drag it to a clear area of the chart. Add axis titles and units so a reader can interpret the coefficients. An equation is not a guarantee that the model predicts well beyond the observed data.
Understand R-squared and forecasting
The R-squared option displays a measure of how closely the model corresponds to the plotted data. For a simple linear fit, a value nearer 1 generally indicates that the line accounts for more of the variation in the data than a value nearer 0. It does not show that the model is appropriate, that the relationship is causal, or that predictions will be accurate. A complicated curve can achieve a high R-squared simply by following fluctuations in a small dataset.
In the Format Trendline pane, Forecast lets you extend the trendline forward or backward by a specified number of units. The meaning of a unit depends on the chart’s horizontal axis and data structure. A forecast of two units on monthly observations may mean two months, while on another chart it may mean two numeric x-axis units. Confirm the axis scale before interpreting the extension.
Forecast extensions are model-based projections, not extra observed data or certainty about future values. They become especially uncertain when extended far beyond the measurements used to fit the line, or when the process changes over time. Label the forecast period and explain assumptions if the chart will be used in a report or presentation.
Common problems and how to fix them
- The Trendline option is unavailable: Confirm that you selected a supported data series in a two-dimensional chart. Excel does not support trendlines for every chart type, including 3-D charts, stacked charts, pie charts, doughnut charts, and radar charts. Try an XY scatter or another supported 2-D chart.
- The curve looks wrong: Check whether the chart type treats the horizontal values as numbers or categories. For unevenly spaced numeric values, change to an XY (Scatter) chart. Also check for blanks, text values, outliers, or an unintended data range.
- Excel will not add an exponential or power trendline: Check for zero or negative values. Exponential and power models have value restrictions; power requires positive x- and y-values, while exponential does not work with zero or negative y-values.
- The equation seems inconsistent with the chart: Check the displayed rounding, the selected series, and the axis units. If a category axis is being used, its positions may represent categories rather than the numeric values you expected.
- The moving average starts later than the data: A moving average needs enough observations to calculate each window. Its initial position and smoothness depend on the selected period, so compare the result with the original points rather than treating the smoothed line as raw data.
Use trendlines responsibly
A trendline is most helpful when the chart has enough relevant observations and the data’s context is understood. A few points can produce a line, but they offer little basis for trusting a longer-term pattern. A sudden policy change, seasonal cycle, one-off event, or change in measurement can make a single trendline an inadequate summary.
Look at the points as well as the line. A curved pattern around a straight trendline may indicate that a linear model misses structure; one isolated point far from the others may influence the fit substantially. Do not remove an outlier just to improve the visual fit. Check whether it is a data error or a genuine event, and explain any exclusions.
Trendlines also do not automatically account for seasonality. Monthly data may rise and fall with the calendar even while its long-term direction is stable. A moving average can make short-term noise less prominent, but it does not by itself explain or remove seasonal effects. Choose a method that matches the question, and present the underlying data when readers need to judge the pattern for themselves.
Frequently Asked Questions
How do I add a trendline to only one series in Excel?
Select the specific series in the chart before choosing Chart Design > Add Chart Element > Trendline. If the chart has several series, each can have its own trendline and settings.
Can I add a trendline to a bar chart?
Excel supports trendlines on some two-dimensional chart types, including bar charts, but not on every chart. If the option is unavailable or the result is hard to interpret, try a 2-D line or XY scatter chart that better matches the data.
What is the best trendline for Excel?
There is no best type for every dataset. Start with a linear model for a roughly steady change, then consider another type only when the data pattern and a sound explanation support it. Avoid choosing a complex curve solely because it raises R-squared.
Can Excel trendlines predict future values?
Yes. Use the Forecast settings in the Format Trendline pane to extend a trendline. The extension is a projection of the selected model, not a guarantee, and uncertainty grows when you project well beyond the observed data.
How do I remove a trendline?
Click the trendline on the chart and press Delete, or use Chart Design > Add Chart Element > Trendline and select None where that option is available. Take care to select the trendline rather than the data series.
Related
- Microsoft Excel Text to Columns: A Practical Guide
- Microsoft Excel: How to Turn Off Flash Fill
- Microsoft Excel Slicers: How They Work and How to Use Them
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Error Bars in Pivot Charts: Limits and WorkaroundsFor practical purposes, Excel PivotCharts are not a reliable place to add error bars, especially custom error bars…
- Excel Pivot Chart: How to Change the Data Source SafelyTo change an Excel PivotChart’s data source, select its associated PivotTable, choose PivotTable Analyze > Change Data Source,…
- Enable Power Pivot in Excel: Steps and CompatibilityTo enable Power Pivot in Excel for Microsoft 365 on Windows, select File > Options > Add-ins, choose…
- Create a Balloon Chart in Excel: A Practical GuideTo create a balloon chart in Excel, arrange your data in columns for X values, Y values, and…
- Excel Pivot Table Value Filter Not Working? FixesIf an Excel PivotTable value filter is not working, first confirm you applied it to a row or…
- How to Make a Column Graph in Google Sheets: A GuideTo make a column graph in Google Sheets, select your data, choose Insert > Chart, then select Column…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.