Microsoft Excel is a popular spreadsheet application that allows users to create charts and graphs. One of the most common ways to create charts is by using trendlines. A trendline is a line that shows the relationship between two data points. It can be used to help identify trends in data, as well as make predictions about future events. To use a trendline in your Microsoft Excel chart, you first need to create a new sheet and name it “Trendlines.” Then, you need to add the following data:
- The first data point should be your original value. This can be any number or string you like.
- The second data point should be the value of the trendline you want to use. You can choose any of the following: linear, exponential, or logarithmic (see below).
- The third data point should be the length of the trendline (in seconds). This will determine how long the line will stay green after being plotted against your original value. You can also set this value to 0 if you don’t want any lines at all on your chart (see below for more information).
- Finally, you can click on “Plot Trendlines” to start plotting your trendlines against your original value and/or against one of the other values provided as input in step 2 above. If you have multiple values for each data point, then you can select one of them from the list provided and plot it against your original value or against one of the other values provided in step 2 above instead (see below for more information).
You can add a trendline to a chart in Excel to show the general pattern of data over time. You can also extend trendlines to forecast future data. Excel makes it easy to do all of this.
A trendline (or line of best fit) is a straight or curved line which visualizes the general direction of the values. They’re typically used to show a trend over time.
In this article, we’ll cover how to add different trendlines, format them, and extend them for future data.
Add a Trendline
You can add a trendline to an Excel chart in just a few clicks. Let’s add a trendline to a line graph.
Select the chart, click the “Chart Elements” button, and then click the “Trendline” checkbox.
This adds the default Linear trendline to the chart.
There are different trendlines available, so it’s a good idea to choose the one that works best with the pattern of your data.
Click the arrow next to the “Trendline” option to use other trendlines, including Exponential or Moving Average.
Some of the key trendline types include:
Linear: A straight line used to show a steady rate of increase or decrease in values. Exponential: This trendline visualizes an increase or decrease in values at an increasingly higher rate. The line is more curved than a linear trendline. Logarithmic: This type is best used when the data increases or decreases quickly, and then levels out. Moving Average: To smooth out the fluctuations in your data and show a trend more clearly, use this type of trendline. It uses a specified number of data points (two is the default), averages them, and then uses this value as a point in the trendline.
To see the full complement of options, click “More Options.”
The Format Trendline pane opens and presents all trendline types and further options. We’ll explore more of these later in this article.
Choose the trendline you want to use from the list, and it will be added to your chart.
Add Trendlines to Multiple Data Series
In the first example, the line graph had only one data series, but the following column chart has two.
If you want to apply a trendline to only one of the data series, right-click on the desired item. Next, select “Add Trendline” from the menu.
The Format Trendline pane opens so you can select the trendline you want.
In this example, a Moving Average trendline has been added to the charts Tea data series.
If you click the “Chart Elements” button to add a trendline without selecting a data series first, Excel asks you to which data series you want to add the trendline.
You can add a trendline to multiple data series.
In the following image, a trendline has been added to the Tea and Coffee data series.
You can also add different trendlines to the same data series.
In this example, Linear and Moving Average trendlines have been added to the chart.
Format Your Trendlines
Trendlines are added as a dashed line and match the color of the data series to which they’re assigned. You might want to format the trendline differently—especially if you have multiple trendlines on a chart.
Open the Format Trendline pane by either double-clicking the trendline you want to format or by right-clicking and selecting “Format Trendline.”
Click the Fill & Line category, and then you can select a different line color, width, dash type, and more for your trendline.
In the following example, I changed the color to orange, so it’s different from the column color. I also increased the width to 2 pts and changed the dash type.
Extend a Trendline to Forecast Future Values
A very cool feature of trendlines in Excel is the option to extend them into the future. This gives us an idea of what future values might be based on the current data trend.
From the Format Trendline pane, click the Trendline Options category, and then type a value in the “Forward” box under “Forecast.”
Display the R-Squared Value
The R-squared value is a number that indicates how well your trendline corresponds to your data. The closer the R-squared value is to 1, the better the fit of the trendline.
From the Format Trendline pane, click the “Trendline Options” category, and then check the “Display R-squared value on chart” checkbox.
A value of 0.81 is shown. This is a reasonable fit, as a value over 0.75 is generally considered a decent one—the closer to 1, the better.
If the R-squared value is low, you can try other trendline types to see if they’re a better fit for your data.