Custom Trendline in Excel: How to Add and Format One

Charts & pivot tables · Updated November 18, 2026

To add a custom trendline in Excel for Microsoft 365 on Windows, select a supported chart, then choose Chart Design > Add Chart Element > Trendline > More Trendline Options. In the Format Trendline pane, choose a model and adjust its settings; use the pane’s Fill & Line options to change the line’s appearance.

What a custom trendline does

A trendline is a line or curve calculated from chart data to make an overall pattern easier to see. It can summarize a general increase, decrease, curved relationship, or smoothed movement. It does not change the underlying worksheet values: it is an analytical element attached to the chart, and it updates when the chart’s source data changes.

“Custom” can mean two different things in Excel. You can customize the model, choosing a linear, exponential, or other fit and adjusting options such as polynomial order. You can also customize the trendline’s appearance, such as its color, width, and dash style. Both kinds of changes are made after selecting a trendline on a supported chart.

Trendlines are available for several two-dimensional chart types, including scatter, bubble, line, column, bar, area, and stock charts. They are not offered for every chart type; for example, pie, doughnut, radar, surface, and 3-D charts do not support them. If the Trendline command is unavailable, check the chart type first.

Add a trendline to a chart

  1. Select the chart, then select the data series that the trendline should describe. A trendline applies to one series at a time, so a chart with several series may need several separate trendlines.
  2. On the ribbon, choose Chart Design > Add Chart Element > Trendline. You can select a common type from the menu, or choose More Trendline Options to open the full settings pane.
  3. In the Format Trendline pane, select a trendline type, such as Linear or Moving Average. The chart updates as you make choices.
  4. Use the pane’s additional options to set a forecast, an intercept, a polynomial order, or the display of the equation and R-squared value, where those options apply.

There is also a quicker chart-based route: select the chart, choose the + (Chart Elements) button beside it, point to Trendline, and use the arrow to choose a type or open more options. The button appears when the chart is selected. If you want to target a particular series, click that series before adding the trendline.

On Excel for Mac, the chart ribbon and trendline settings are broadly similar, though the pane layout and some control placement can differ. Excel for the web may not expose the same full set of chart-formatting controls as the desktop app. For detailed model settings or line styling, open the workbook in the desktop version of Excel.

Choose the right trendline type

The best fit depends on the question and the shape of the data, not on which line looks most impressive. Start with a model that has a plausible explanation, then inspect whether it follows the observations without bending unnecessarily.

  • Linear: A straight line, useful when the values change at a roughly constant rate. For example, monthly units sold that rise by a similar amount each month may be reasonably summarized by a linear trend.
  • Exponential: A curve that can represent growth or decline at a roughly constant percentage rate. It requires positive y-values; it cannot be fitted in the usual way when the series contains zero or negative values.
  • Logarithmic: A curve that changes quickly at first and then levels off, or the reverse. Its x-values must be positive. It may suit a pattern with diminishing gains as x increases.
  • Polynomial: A curve that can turn or bend, useful when the data has one or more broad rises and falls. Excel lets you choose an order from 2 through 6. A higher order can follow the plotted points more closely but may also create a misleading, overly complex curve.
  • Power: A curved relationship in which y changes according to a power of x. The x- and y-values must be positive. It can be useful for certain scaling relationships, but should not be selected just because it produces a close-looking fit.
  • Moving Average: A smoothed line based on the average of a chosen number of neighboring points. The period controls how many points contribute to each average: a larger period smooths more variation but can hide short-term changes.

Excel’s fit is mathematical, not a judgment about cause. A curved trendline does not prove that one variable causes another, and a good visual fit within the displayed data does not guarantee accurate future values.

Set forecast, intercept, and polynomial options

In the Format Trendline pane, the Forecast fields extend a trendline forward or backward beyond the observed data. The number is measured in units along the chart’s horizontal scale. In an XY scatter chart, those units are numeric x-values. In a line chart, the horizontal axis is normally a sequence of categories, so the extension corresponds to category positions rather than necessarily representing a fixed number of days or months. Use a scatter chart when the actual numeric spacing between x-values matters.

The Set Intercept option forces the fitted line or curve to cross the y-axis at a specified value. This can be appropriate when there is a defensible reason that the relationship must pass through a known point, such as a zero baseline in a particular measurement. Otherwise, forcing an intercept can distort the fit and make the trendline less representative of the data.

For a polynomial trendline, the order controls its complexity. A second-order polynomial can form one broad bend; higher orders can create additional bends. Choose the lowest order that captures a meaningful pattern. A high-order curve may fit the historical points closely while behaving erratically between them or beyond the data range, so it is not automatically a better forecasting choice.

Show and interpret the equation and R-squared

Excel can display the fitted equation on the chart and, for applicable trendline types, the R-squared value. These options are in the Format Trendline pane. The equation describes the mathematical form of the selected fit, while R-squared indicates how closely that model accounts for variation in the plotted data under the model’s assumptions. Neither is a guarantee that the model is appropriate or will predict new observations well.

For example, a linear equation displayed as y = 2.4x + 10 describes a fitted line with a slope of 2.4 and an intercept of 10. The meaning of those numbers depends on the chart’s units and x-axis. If x represents months numbered 1, 2, 3, the slope is per category step; if x represents elapsed days in a scatter chart, it is per day. Equation labels can also show rounded coefficients, so a displayed equation may not reproduce the chart precisely when recalculated from its rounded text.

R-squared is most useful for comparing fits to the same data in context, not as a stand-alone quality score. A complex polynomial can have a higher R-squared simply because it has more flexibility. A high value does not establish causation, rule out outliers, or show that a forecast is reliable. Excel’s moving-average trendline does not provide the same equation and R-squared display as fitted equation types.

Change the trendline’s appearance

To format the line, select the trendline itself. If selecting it is difficult, click the chart and use the chart element selection controls, or click near the line until Excel identifies the trendline rather than the data series. In the Format Trendline pane, open Fill & Line (the paint-bucket icon) to adjust the line’s color, width, transparency, and dash type. The precise controls shown can vary with the selected chart object and Excel build.

Make the trendline visually distinct from the data without making it dominate the chart. A contrasting color or dashed stroke can help readers distinguish the fitted line from observed values. If the chart has multiple series, use a consistent but clear styling scheme, and consider adding a legend entry or a text label that identifies which series the line describes. Formatting only changes how the line is drawn; it does not change the model or its calculations.

Check the data and chart before trusting the result

A surprising trendline can reflect the data layout rather than a useful pattern. Check that the chart includes the intended observations, that dates are in chronological order, and that blanks, text, and error values are handled as expected. Also inspect outliers: one unusual point can pull a fitted line substantially, especially in a small dataset.

Pay close attention to the horizontal axis. A line chart generally treats its labels as evenly spaced categories, even if labels are dates with unequal gaps. An XY scatter chart uses numeric x-values and preserves their spacing. If measurements were taken on irregular dates, a line chart can make the time intervals look equal when they are not; a scatter chart is often the better choice for analyzing the relationship against actual elapsed time.

Finally, keep the plotted range in view. Forecasting a short distance beyond the observed data is different from projecting far into the future. A trendline extrapolates the selected mathematical pattern; it does not know about changing conditions, seasonality, or limits in the real process. Use other evidence and validation, rather than extending the line simply because Excel allows it.

Common problems and practical fixes

  • The Trendline command is missing: Confirm that a supported two-dimensional chart is selected. If the chart is 3-D or a pie-style chart, change its type to a compatible one.
  • The line appears on the wrong data: Select the intended series before adding the trendline. Each series has its own trendline settings.
  • The fit option is unavailable or fails: Some models require positive values. Check for zero or negative x- or y-values before choosing exponential, logarithmic, or power fits.
  • The line seems misplaced on dates: Check whether the chart uses a category axis or numeric x-axis. Use an XY scatter chart when real spacing between dates or measurements must be represented.
  • The equation does not match a manual calculation: The chart label may round coefficients. Also verify the selected series and the chart’s x-values; a line chart may use category positions rather than the visible date labels as numeric x-values.
  • The curve changes sharply at its ends: Reduce the polynomial order or choose a simpler model. A complicated curve can be an overfit rather than evidence of a genuine pattern.

Frequently Asked Questions

Can I add a trendline to only one series in an Excel chart?
Yes. Select the particular data series and add a trendline; Excel associates it with that series. Repeat the process for another series if you need a separate fit.

How do I make a trendline curved in Excel?
Open Chart Design > Add Chart Element > Trendline > More Trendline Options, then choose a curved model such as Polynomial, Exponential, Logarithmic, or Power. The data must meet that model’s requirements, and polynomial order should be kept as low as reasonably possible.

Can I change the trendline color and thickness?
Yes. Select the trendline, open the Format Trendline pane, and use Fill & Line to change its line color, width, and dash style.

Why can’t I add an exponential trendline to my data?
An exponential trendline requires positive y-values. If the series includes zero or negative values, Excel cannot fit that model as usual. Check the data and consider a model that is mathematically suitable instead of changing values merely to force a fit.

Can Excel show a trendline equation on the chart?
For supported fitted trendline types, select the trendline and enable Display Equation on chart in the Format Trendline pane. The displayed coefficients may be rounded; use the chart as a visual summary, not as a substitute for full-precision analysis.

Does a trendline predict future values automatically?
A trendline can be extended with the Forecast setting, but that is an extrapolation of the chosen model, not a guarantee. Treat long-range extensions cautiously, particularly when the data is seasonal, irregular, or likely to be affected by changing conditions.

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.