Insert a linear forecast trendline in the Column chart that forecasts forward by 3.0 future periods

on May 30, 2006, 12:00 AM PDT

Forecast the future with Excel trendlines

Trying to predict the future based on past experiences, but you're lacking the right formula? If you've forgotten high school algebra, fear not. With trendlines, Excel can project future figures based on previous history. Mary Ann Richardson points the way.

Let’s say you are keeping track of monthly sales figures for
the past six months [January through June], and you want to know what the overall sales will likely be for the second half of the year. You can use trendlines to have Excel predict the answers based on your
previous data. Follow these steps:

  1. Create
    a bar chart of the data you’ve tracked so far.
  2. Click
    on your chart, and then click on the data series.
  3. Go
    to Chart | Add Trendline.
  4. Click
    on the Options tab.
  5. In
    the Forecast section, click on the up arrow in the Forecast box until the
    entry in the box changes to 6.
  6. Click
    OK.

Excel will extend the trendline to
show estimated monthly sales figures for the rest of the year.

Miss a tip?

Check out the Microsoft Excel archive, and catch up on our most recent Excel tips.

Help users increase productivity by automatically signing up for TechRepublic’s free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.

  • Software

The tutorial explains how to do trend analysis in Excel: how to insert a trendline in a chart, display its equation and get the slope of a trendline.

When plotting data in a graph, you may often want to visualize the general trend in your data. This can be done by adding a trendline to a chart. Luckily, Microsoft Excel has made inserting a trend line very easy, especially in newer versions. Nevertheless, there are a few little secrets that make a big difference, and I will share them with you in a moment.

Trendline in Excel

A trendline, also referred to as a line of best fit, is a straight or curved line in a chart that shows the general pattern or overall direction of the data.

This analytical tool is most often used to show data movements over a period of time or correlation between two variables.

Visually, a trendline looks somewhat similar to a line chart, but it doesn't connect the actual data points as a line chart does. A best-fit line shows the general trend in all the data, ignoring statistical errors and minor exceptions. In some cases, it can also be used to forecast trends.

Excel graphs that support trendlines

A trendline can be added to a variety of Excel charts, including XY scatter, bubble, stock, as well as unstacked 2-D bar, column, area and line graphs.

You cannot add a trendline to 3-D or stacked charts, pie, radar and similar visuals.

Below, there is an example of a scatter plot with an extended trendline:

How to add a trendline in Excel

In Excel 2019, Excel 2016 and Excel 2013, adding a trend line is a quick 3-step process:

  1. Click anywhere in the chart to select it.
  2. On the right side of the chart, click the Chart Elements button [the cross button], and then do one of the following:

Tip. Another quick way to add trendline to an Excel chart is to right-click the data series and then click Add Trendline….

How to make a trendline in Excel 2010

To add a trendline in Excel 2010, you follow a different route:

  1. On a chart, click the data series for which you want to draw a trendline.
  2. Under Chart Tools, go to the Layout tab > Analysis group, click Trendline and either:
    • Pick one of the predefined options, or
    • Click More Trendline Options…, and then choose the trendline type for your chart.

How to insert multiple trendlines in the same chart

Microsoft Excel allows adding more than one trendline to a chart. There are two scenarios that should be handled differently.

Add a trendline for each data series

To put a trendline on a chart that has two or more data series, here's what you do:

  1. Right-click the data points of interest [blue ones in this example] and choose Add Trendline… from the context menu:
  2. This will open the Trendline Options tab of the pane, where you can choose the desired line type:
  3. Repeat the above steps for the other data series.

As the result, each data series will have its own trendline of the matching color:

Alternatively, you can click the Chart Elements button, then click the arrow next to Trendline and choose the type you want. Excel will show a list of the data series plotted in your chart. You pick the needed one and click OK.

Draw different trendline types for the same data series

To make two or more different trendlines for the same data series, add the first trendline as usual, and then do one of the following:

  • Right-click the data series, select Add Trendline… in the context menu, and then choose a different trend line type on the pane.
  • Click the Chart Elements button, click the arrow next to Trendline and choose the type you want to add.

Either way, Excel will display multiple trendlines in the chart, Linear and Moving average in our case, for which you can set different colors:

How to format a trendline in Excel

To make your graph even more understandable and easily interpreted, you may want to change the default appearance of a trendline. For this, right-click it and then click Format Trendline… . Or simply double-click the trendline to open the Format Trendline pane.

On the pane, switch to the Fill & Line tab and choose the color, width and dash type for your trendline. For example, you can make it a solid line rather than a dashed line:

How to extend trendline in Excel

To project the data trends into the future or past, this is what you need to do:

  1. Double-click the trendline to open the Format Trendline pane.
  2. On the Trendline Options tab [the last one], type the desired values in the Forward and/or Backward boxes under Forecast:

In this example, we choose to extend the trendline for 8 periods beyond the last data point:

Excel trendline equation

Trendline equation is a formula that mathematically describes the line that best fits the data points. The equations are different for different trendline types, though in every equation Excel uses the least squares method to find the best fit for a line though data points. You can find the equations for all Excel trendlines types in this tutorial.

When drawing the line of best fit in Excel, you can display its equation in a chart. Additionally, you can display the R-squared value.

R-squared value [Coefficient of Determination] indicates how well the trendline corresponds to the data. The closer the R2 value to 1, the better the fit.

How to display the trendline equation on a chart

To show the equation and R-squared value on a chart, do the following:

  1. Double-click the trendline to open its pane.
  2. On the pane, switch to the Trendline Options tab and check these boxes:
    • Display Equation on chart
    • Display R-squared value on chart

This will put the trendline formula and the R2 value at the top of your graph, and you are free to drag them wherever you see fit.

In this example, the R-squared value equals 0.957, which means that the trendline fits about 95% of data values.

Note. The equation displayed on an Excel chart is correct only for XY scatter plots. For more information, please see Why Excel trendline equation is wrong.

Show more digits in the trendline equation

If the Excel trendline equation delivers inaccurate results when you supply x values to it manually, most likely it's because of rounding. By default, the numbers in the trendline equation are rounded to 2 - 4 decimal places. However, you can easily make more digits visible. Here's how:

  1. Select the trendline formula in the chart.
  2. On the Format Trendline Label pane that appears, go to the Label Options tab.
  3. In the Category drop-down list, select Number.
  4. In the Decimal places box, type the number of decimal places you want to show [up to 30] and press Enter to update the equation in the chart.

How to find the slope of a trendline in Excel

To get the slope of the linear trendline, Microsoft Excel provides a special function of the same name:

SLOPE[known_y's, known_x's]

Where:

  • Known_y's is a range of the dependent data points plotted on the y-axis.
  • Known_x's is a range of the independent data points plotted on the x-axis.

With the x values in B2:B13 and the y values in C2:C13, the formula goes as follows:

=SLOPE[C2:C13, B2:B13]

The slope can also be calculated by using the LINEST function in a regular formula:

=LINEST[C2:C13,B2:B13]

If entered as an array formula by pressing Ctrl + Shift + Enter, it would return the slope of the trendline and y-intercept into two adjacent cells in the same row. For more information, please see How to use the LINEST function in Excel.

As you can see in the following screenshot, the slope value returned by the formulas exactly matches the slope coefficient in the linear trendline equation displayed in our graph:

The coefficients of other trendline equation types [Exponential, Polynomial, Logarithmic, etc.] can also be calculated, but you'd need to use more complex formulas explained in Excel trendline equations.

How to delete a trendline in Excel

To remove a trendline from your chart, right-click the line, and then click Delete:

Or click the Chart Elements button and unselect the Trendline box:

Either way, Excel will immediately remove the trendline from a chart.

That's how to do a trendline in Excel. I thank you for reading and hope to see you on our blog next week!

You may also be interested in

How do you insert a linear forecast trendline in the column chart?

Add a trendline.
Select a chart..
Select the + to the top right of the chart..
Select Trendline. Note: Excel displays the Trendline option only if you select a chart that has more than one data series without selecting a data series..
In the Add Trendline dialog box, select any data series options you want, and click OK..

How do you insert a linear forecast trendline in the column chart that forecasts forward by 3 future periods?

Trendline in Excel.
Select the chart..
Click the + button on the right side of the chart, click the arrow next to Trendline and then click More Options. ... .
Choose a Trend/Regression type. ... .
Specify the number of periods to include in the forecast. ... .
Check "Display Equation on chart" and "Display R-squared value on chart"..

How do I create a forecast trendline in Excel?

Follow these steps:.
Create. a bar chart of the data you've tracked so far..
Click. on your chart, and then click on the data series..
Go. to Chart | Add Trendline..
Click. on the Options tab..
In. the Forecast section, click on the up arrow in the Forecast box until the. entry in the box changes to 6..
Click. OK..

How do you add a trendline to a chart in PowerPoint?

Once we have the chart inserted in the PowerPoint slide, we can right click to display the popup menu and click Add Trendline. This option will display a new dialog box where you can configure the moving average line or trendline. The line will be added to the existing PowerPoint chart to show the trend.

Chủ Đề