Add a trend or moving average line to a chart

Add a trend or moving average line to a chart

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

Add a trendline

  1. Select a chart.

  2. Select a point in the data series (e.g. line chart, column chart, or bar chart).

  3. Right-click and select Add Trendline.

To format a trendline, select Format Trendline > Trendline Options.

Add drop lines

  1. Select the chart in which you want to add drop lines.

  2. Select Design > Add Chart Element > Lines > Drop Lines.

Add a trendline

  1. On an unstacked, 2-D, area, bar, column, line, stock, xy (scatter), or bubble chart, click the data series to which you want to add a trendline or moving average, or do the following to select the data series from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow next to the Chart Elements box, and then click the chart element that you want.

      Current Selection group on the Layout tab (Chart Tools)

  2. Note: If you select a chart that has more than one data series without selecting a data series, Excel displays the Add Trendline dialog box. In the list box, click the data series that you want, and then click OK.

  3. On the Layout tab, in the Analysis group, click Trendline.

    Analysis group on the Layout tab (Chart Tools)

  4. Do one of the following:

    1. Click a predefined trendline option that you want to use.

      Note: This applies a trendline without enabling you to select specific options.

    2. Click More Trendline Options, and then in the Trendline Options category, under Trend/Regression Type, click the type of trendline that you want to use.

Use this type

To create

Linear

A linear trendline by using the following equation to calculate the least squares fit for a line:

equation

where m is the slope and b is the intercept.

Logarithmic

A logarithmic trendline by using the following equation to calculate the least squares fit through points:

equation

where c and b are constants, and ln is the natural logarithm function.

Polynomial

A polynomial or curvilinear trendline by using the following equation to calculate the least squares fit through points:

equation

where b and Variable are constants.

Power

A power trendline by using the following equation to calculate the least squares fit through points:

equation

where c and b are constants.

Note: This option is not available when your data includes negative or zero values.

Exponential

An exponential trendline by using the following equation to calculate the least squares fit through points:

equation

where c and b are constants, and e is the base of the natural logarithm.

Note: This option is not available when your data includes negative or zero values.

Moving average

A moving average trendline by using the following equation: equation

Note: The number of points in a moving average trendline equals the total number of points in the series less the number that you specify for the period.

R-squared value

A trendline that displays an R-squared value on a chart by using the following equation:

equation

This trendline option is available on the Options tab of the Add Trendline or Format Trendline dialog box.

Note: The R-squared value that you can display with a trendline is not an adjusted R-squared value. For logarithmic, power, and exponential trendlines, Excel uses a transformed regression model.

  1. If you select Polynomial, type the highest power for the independent variable in the Order box.

  2. If you select Moving Average, type the number of periods that you want to use to calculate the moving average in the Period box.

  3. If you add a moving average to an xy (scatter) chart, the moving average is based on the order of the x values plotted in the chart. To get the result that you want, you might have to sort the x values before you add a moving average.

  4. If you add a trendline to a line, column, area, or bar chart, the trendline is calculated based on the assumption that the x values are 1, 2, 3, 4, 5, 6, etc.. This assumption is made whether the x-values are numeric or text. To base a trendline on numeric x values, you should use an xy (scatter) chart.

  5. Excel automatically assigns a name to the trendline, but you can change it. In the Format Trendline dialog box, in the Trendline Options category, under Trendline Name, click Custom, and then type a name in the Custom box.

Tips

  • You can also create a moving average, which smoothes out fluctuations in data and shows the pattern or trend more clearly.

  • If you change a chart or data series so that it can no longer support the associated trendline — for example, by changing the chart type to a 3-D chart or by changing the view of a PivotChart report or associated PivotTable report — the trendline no longer appears on the chart.

  • For line data without a chart, you can use AutoFill or one of the statistical functions, such as GROWTH() or TREND(), to create data for best-fit linear or exponential lines.

What else would you like to do?

  1. On an unstacked, 2-D, area, bar, column, line, stock, xy (scatter), or bubble chart, click the trendline that you want to change, or do the following to select it from a list of chart elements.

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow next to the Chart Elements box, and then click the chart element that you want.

      Current Selection group on the Layout tab (Chart Tools)

  2. On the Layout tab, in the Analysis group, click Trendline, and then click More Trendline Options.

    Analysis group on the Layout tab (Chart Tools)

  3. To change the color, style, or shadow options of the trendline, click the Line Color, Line Style, or Shadow category, and then select the options that you want.

  1. On an unstacked, 2-D, area, bar, column, line, stock, xy (scatter), or bubble chart, click the trendline that you want to change, or do the following to select it from a list of chart elements.

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow next to the Chart Elements box, and then click the chart element that you want.

      Current Selection group on the Layout tab (Chart Tools)

  2. On the Layout tab, in the Analysis group, click Trendline, and then click More Trendline Options.

    Analysis group on the Layout tab (Chart Tools)

  3. To specify the number of periods that you want to include in a forecast, under Forecast, click a number in the Forward periods or Backward periods box.

  1. On an unstacked, 2-D, area, bar, column, line, stock, xy (scatter), or bubble chart, click the trendline that you want to change, or do the following to select it from a list of chart elements.

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow next to the Chart Elements box, and then click the chart element that you want.

      Current Selection group on the Layout tab (Chart Tools)

  2. On the Layout tab, in the Analysis group, click Trendline, and then click More Trendline Options.

    Analysis group on the Layout tab (Chart Tools)

  3. Select the Set Intercept = check box, and then in the Set Intercept = box, type the value to specify the point on the vertical (value) axis where the trendline crosses the axis.

    Note: You can do this only when you use an exponential, linear, or polynomial trendline.

  1. On an unstacked, 2-D, area, bar, column, line, stock, xy (scatter), or bubble chart, click the trendline that you want to change, or do the following to select it from a list of chart elements.

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow next to the Chart Elements box, and then click the chart element that you want.

      Current Selection group on the Layout tab (Chart Tools)

  2. On the Layout tab, in the Analysis group, click Trendline, and then click More Trendline Options.

    Analysis group on the Layout tab (Chart Tools)

  3. To display the trendline equation on the chart, select the Display Equation on chart check box.

    Note: You cannot display trendline equations for a moving average.

Tip: The trendline equation is rounded to make it more readable. However, you can change the number of digits for a selected trendline label in the Decimal places box on the Number tab of the Format Trendline Label dialog box. (Format tab, Current Selection group, Format Selection button).

  1. On an unstacked, 2-D, area, bar, column, line, stock, xy (scatter), or bubble chart, click the trendline for which you want to display the R-squared value, or do the following to select the trendline from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow next to the Chart Elements box, and then click the chart element that you want.

      Current Selection group on the Layout tab (Chart Tools)

  2. On the Layout tab, in the Analysis group, click Trendline, and then click More Trendline Options.

    Analysis group on the Layout tab (Chart Tools)

  3. On the Trendline Options tab, select Display R-squared value on chart.

Note: You cannot display an R-squared value for a moving average.

  1. On an unstacked, 2-D, area, bar, column, line, stock, xy (scatter), or bubble chart, click the trendline that you want to remove, or do the following to select the trendline from a list of chart elements:

    1. Click anywhere in the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow next to the Chart Elements box, and then click the chart element that you want.

      Current Selection group on the Layout tab (Chart Tools)

  2. Do one of the following:

    1. On the Layout tab, in the Analysis group, click Trendline, and then click None.

      Analysis group on the Layout tab (Chart Tools)

    2. Press DELETE.

Tip: You can also remove a trendline immediately after you add it to the chart by clicking Undo Undo button on the Quick Access Toolbar, or by pressing CTRL+Z.

  1. On the View menu, click Print Layout.

  2. In the chart, select the data series that you want to add a trendline to, and then click the Chart Design tab. 

    For example, in a line chart, click one of the lines in the chart, and all the data marker of that data series become selected.

    Chart Design tab

  3. On the Chart Design tab, click Add Chart Element, and then click Trendline.

    Add a trendline

  4. Choose a trendline option or click More Trendline Options.

    Trendline options

    You can choose from the following:

    • Exponential

    • Linear

    • Logarithmic

    • Polynomial

    • Power

    • Moving average

    You can also give your trendline a name and choose forecasting options.

  1. On the View menu, click Print Layout.

  2. Click the chart with the trendline, and then click the Chart Design tab.

    Chart Design tab

  3. Click Add Chart Element, click Trendline, and then click None.

    Remove trandline

    You can also click the trendline and press DELETE .

Word

  1. On the View menu, click Print Layout.

  2. In the chart, select the data series that you want to add a trendline to, and then click the Chart Layout tab. 

    For example, in a line chart, click one of the lines in the chart, and all the data marker of that data series become selected.

  3. Under Analysis, click Trendline, and then click the trendline that you want.

    Chart Layout tab, Analysis group

    If you see the Add Trendline dialog box, select the series that you want to add the trendline to.

    To customize a trendline name or add an equation label, under Analysis, click Trendline, and then click Trendline Options. In the navigation pane, click Options, and then make the changes that you want.

  1. On the View menu, click Print Layout.

  2. Click the chart with the trendline, and then click the Chart Layout tab.

  3. Under Analysis, click Trendline, and then click No Trendline.

    Chart Layout tab, Analysis group

    You can also click the trendline and press DELETE .

PowerPoint

  1. In the chart, select the data series that you want to add a trendline to, and then click the Chart Layout tab. 

    For example, in a line chart, click one of the lines in the chart, and all the data marker of that data series become selected.

  2. Under Analysis, click Trendline, and then click the trendline that you want.

    Chart Layout tab, Analysis group

    If you see the Add Trendline dialog box, select the series that you want to add the trendline to.

    To customize a trendline name or add an equation label, under Analysis, click Trendline, and then click Trendline Options. In the navigation pane, click Options, and then make the changes that you want.

  1. Click the chart with the trendline, and then click the Chart Layout tab.

  2. Under Analysis, click Trendline, and then click No Trendline.

    Chart Layout tab, Analysis group

    You can also click the trendline and press DELETE .

Excel

  1. In the chart, select the data series that you want to add a trendline to, and then click the Chart Layout tab. 

    For example, in a line chart, click one of the lines in the chart, and all the data marker of that data series become selected.

  2. Under Analysis, click Trendline, and then click the trendline that you want.

    Chart Layout tab, Analysis group

    If you see the Add Trendline dialog box, select the series that you want to add the trendline to.

    Tip: To customize a trendline name or add an equation label, under Analysis, click Trendline, and then click Trendline Options. In the navigation pane, click Options, and then make the changes that you want.

  1. Click the chart with the trendline, and then click the Chart Layout tab.

  2. Under Analysis, click Trendline, and then click No Trendline.

    Chart Layout tab, Analysis group

    You can also click the trendline and press DELETE .

See also

Edit data in a chart

Animate text, objects, and charts in PowerPoint for Mac

See Also

Trendline options in Office

Create a chart from start to finish

Format elements of a chart

Add data labels to a chart

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×