Adding a trend line in Excel shows the direction your data is moving

A trend line (also called a line of best fit) is a straight or curved line that runs through your data points on a chart. It helps you see the overall pattern instead of getting lost in individual ups and downs. Excel can draw this line for you automatically, and you can choose what type of line fits your data best.

The process takes about 30 seconds once your chart exists: right-click the data series, select "Add Trendline", pick your line type, and Excel draws it. You can also add a formula to the chart so anyone reading it knows the exact mathematical relationship.

Key Takeaways

  • You need a chart already made in Excel before you can add a trend line — the trend line feature only works on existing charts, not raw data.
  • Right-click directly on one of your data points (the dots or bars), not on the chart background, or the menu will not show the trend line option.
  • Linear trend lines work for data that moves steadily up or down; polynomial lines work for data that curves or changes direction.
  • Checking "Display Equation on chart" shows the formula Excel used, which tells you the exact slope and starting point of the line.

Creating a chart before you add the trend line

You cannot add a trend line to raw numbers in a spreadsheet — you need a chart first. Select your data (including headers), go to the Insert tab, and choose a chart type. For a trend line, a scatter plot or line chart works best because they show individual data points clearly.

Once your chart appears on the spreadsheet, click on it to select it. You should see a border around the chart with small squares at the corners. Now you are ready to add the trend line.

Right-clicking the data series to open the trend line menu

Click directly on one of your data points — a dot on a scatter plot, a point on a line, or the top of a bar. The entire data series (all the points) should highlight. Right-click on that highlighted point, and a menu appears.

Look for "Add Trendline" in the menu. If you see "Format Data Series" or other options but not "Add Trendline", you clicked on the chart background instead of the data. Click away to deselect, then try again, making sure to click on an actual data point.

Choosing between linear and polynomial trend lines

When you click "Add Trendline", a panel opens on the right side of your screen (in Excel 2016 and newer) or a dialog box appears (in older versions). The default is a linear trend line, which draws a straight line through your data. Use this when your data moves steadily in one direction — sales increasing month by month, or temperature rising over time.

If your data curves, peaks, or changes direction, choose polynomial instead. A polynomial line bends to follow the shape of your data more closely. The "Order" number controls how much it bends: Order 2 creates a gentle curve, Order 3 creates more bends, and higher orders follow the data even more tightly. Start with Order 2 and increase only if the line does not match your data's shape.

Other options like exponential or logarithmic lines exist for specialized data (exponential for growth that speeds up, logarithmic for growth that slows down), but linear and polynomial handle most everyday spreadsheets.

Displaying the equation and R-squared value

In the trend line panel, check the box next to "Display Equation on chart". This adds a formula to your chart that shows the exact relationship between your variables. For a linear line, the equation looks like y = 2.5x + 10, which means for every unit increase in x, y increases by 2.5.

You can also check "Display R-squared value on chart". The R-squared number (ranging from 0 to 1) tells you how well the trend line fits your actual data. A value close to 1 means the line matches your data very closely; a value close to 0 means the line does not capture the pattern well. If your R-squared is below 0.7, your data may not follow a simple trend, or you may have chosen the wrong line type.

Adjusting the trend line appearance

Once the trend line appears on your chart, you can change how it looks. Right-click on the trend line itself (not the data points), and select "Format Trendline". You can change the line color, thickness, and style (solid, dashed, dotted). These changes are purely visual and do not affect the math behind the line.

You can also set how far into the future the line extends by adjusting the "Forecast" settings in the format panel. This is useful if you want to show where the trend would go if it continued, but remember that real data often does not follow predictions perfectly.

Removing or replacing a trend line

If you add a trend line and decide you do not want it, right-click on the trend line and select "Delete". The line disappears, but your chart and data stay intact. You can add a different type of trend line by repeating the steps above — Excel will replace the old one with the new one.

You can also have multiple trend lines on the same chart if you have multiple data series. Click on each series separately and add its own trend line. This is useful when comparing how different variables change over time.

Frequently Asked Questions

Why does the trend line option not appear when I right-click?

You clicked on the chart background or a chart element (like the title or axis) instead of a data point. Click away to deselect, then click directly on a dot, bar, or point on the line itself. The entire data series should highlight before you right-click.

Can I add a trend line to a pie chart or doughnut chart?

No. Trend lines only work on charts that plot individual data points, like scatter plots, line charts, bar charts, and area charts. Pie and doughnut charts show parts of a whole, not a series of values over time, so a trend line does not make sense.

What does the R-squared value mean in plain terms?

R-squared tells you how much of your data's variation the trend line explains. An R-squared of 0.85 means the trend line accounts for 85% of the ups and downs in your data; the remaining 15% is random variation or factors the trend line does not capture. Higher is better, but real-world data rarely reaches 0.95.

Can I use the trend line equation to predict future values?

Yes, you can plug future x-values into the equation to estimate y-values. However, this assumes the trend continues unchanged, which often does not happen in real situations. Use predictions cautiously and only for a short distance into the future.

What is the difference between a trend line and a moving average?

A trend line is a single line that represents the overall direction of your data. A moving average smooths out short-term bumps by averaging nearby points. Excel offers both options in the Add Trendline menu — moving average appears as a separate choice below the line type options.