Adding a regression line shows the trend in your data
A regression line is a straight line that runs through your data points to show the overall direction they're moving. In Excel, you add it by creating a chart first, then telling Excel to draw the line. The line helps you see patterns — whether sales are climbing, whether a cost is dropping, or whether two things move together.
You'll need a chart already made from your data. If you don't have one yet, select your data (two columns work best — one for what you're measuring on the left side, one for what you're measuring on the bottom), go to the Insert tab, and pick Scatter or Line Chart. Once your chart exists, adding the regression line takes about 30 seconds.
Key Takeaways
- A regression line is a straight line through your data that shows whether values are going up, down, or staying flat over time.
- You must have a chart already created before you can add a regression line — Excel won't let you add one to raw numbers in cells.
- Right-click any data point on your chart, select Add Trendline, then pick Linear to draw a straight-line trend.
- You can display the equation and R-squared value on the chart itself to see how well the line fits your actual data.
Create your chart before adding the regression line
Excel can only add a regression line to a chart, not to raw data in cells. Start by selecting the two columns of numbers you want to chart. Click the first cell in your first column, hold Shift, and click the last cell in your second column. Include headers (like "Month" and "Sales") if you have them — Excel will recognize them and label your chart automatically.
Go to the Insert tab at the top of the ribbon. Click Scatter if your data points don't follow a strict time order, or Line Chart if they do (like monthly sales over a year). A chart will appear on your sheet. You can move it by clicking and dragging, or resize it by dragging the corners. The exact position doesn't matter — you just need a working chart before the next step.
Right-click a data point and select Add Trendline
Click anywhere on the chart to select it. You'll see a border appear around the chart. Now right-click on one of the data points (the dots or markers on the chart itself, not the background). A menu will pop up. Look for Add Trendline and click it.
A panel will open on the right side of your screen called Trendline Options. At the top, you'll see several choices: Exponential, Linear, Logarithmic, Polynomial, and others. For a basic regression line, click Linear. This draws a straight line through your data. The line will appear on your chart when ready.
Show the equation and R-squared value on your chart
The regression line itself shows the trend, but two numbers tell you how useful that trend is. While the Trendline Options panel is still open on the right, look for checkboxes near the bottom. Check the box next to Display Equation on chart and the box next to Display R-squared value on chart.
The equation (something like y = 2.5x + 10) tells you the exact formula of your line — useful if you want to predict future values. The R-squared value (a number between 0 and 1) tells you how well the line fits your actual data. A value close to 1 means the line matches your data tightly. A value close to 0 means your data is scattered and the line is just a rough guess. Both numbers will now appear as text on your chart.
Adjust the line color or style if you want
The regression line appears in a default color (usually blue or red). If you want to change how it looks, right-click the line itself (not the data points, but the actual trend line). Select Format Trendline. A panel opens with options for Line Color, Line Style (solid, dashed, dotted), and Width.
Pick whatever makes the line easiest to see against your data points. A thicker line or a contrasting color helps if you're printing the chart or showing it in a presentation. When you're done, click outside the chart to close the panel and see your finished result.
Understanding what the regression line tells you
A regression line that slopes upward means your values are increasing over time or as the other variable increases. A line that slopes downward means values are decreasing. A nearly flat line means there's little change — the variable stays roughly the same.
The steeper the slope, the faster the change. If your line goes from bottom-left to top-right at a steep angle, values are climbing quickly. If it's a gentle slope, values are climbing slowly. The R-squared value matters because a line can slope upward even if your actual data points are all over the place — a low R-squared tells you the trend is weak and predictions based on it won't be reliable.
Common reasons the regression line doesn't appear
If you right-click and don't see Add Trendline, you probably clicked the chart background instead of a data point. Click directly on one of the dots, squares, or other markers on the chart itself. If you still don't see the option, make sure your chart is a type that supports trendlines — pie charts and doughnut charts don't work, but scatter, line, column, and bar charts do.
If the line appears but looks wrong (like it's not touching your data at all), check that you selected Linear in the Trendline Options. Other options like Polynomial or Exponential draw different shapes that may not match what you're looking for. Switch back to Linear for a straight line.
Frequently Asked Questions
Can I add more than one regression line to the same chart?
Yes. Right-click a different data series (if you have multiple series on one chart) and add a trendline to that series too. Each series can have its own regression line. This is useful when comparing trends across different categories or time periods on the same chart.
What does the R-squared value mean in plain terms?
R-squared tells you what percentage of your data's ups and downs the line explains. An R-squared of 0.85 means the line accounts for 85% of the variation — pretty good. An R-squared of 0.30 means the line only explains 30% — your data is scattered and the trend is weak. Higher is always better.
Can I use the equation to predict future values?
Yes, but only if your R-squared is reasonably high (above 0.7 is a good rule of thumb). The equation tells you the formula — plug in a future month or value for x, and it calculates y. With a weak R-squared, predictions will be unreliable because your actual data doesn't follow the line closely.
What's the difference between Linear and Polynomial trendlines?
Linear draws a straight line. Polynomial draws a curved line that can bend and follow your data more closely. Use Linear for straightforward trends. Use Polynomial if your data curves or changes direction — but be careful, because a curved line can fit your current data perfectly while being useless for predictions.
Does adding a regression line change my original data?
No. The regression line is only drawn on the chart — it doesn't add or change any numbers in your cells. You can delete the line anytime by right-clicking it and selecting Delete, and your data stays exactly as it was.