Add a regression line by right-clicking your chart's data series

A regression line is a straight line drawn through your data points that shows the overall trend. In Excel, you add it directly to an existing chart in three steps: right-click the data series (the dots or bars), select "Add Trendline", then choose "Linear" and check the box to display the equation on the chart if you want it.

The regression line works on scatter plots, line charts, column charts, and bar charts. It does not work on pie charts or doughnut charts. If your data is already plotted, you have everything you need — no separate calculation or formula required.

Key Takeaways

  • Right-click the data series in your chart, not the chart background, to access the trendline option.
  • Excel's Linear trendline is the standard regression line and works for most comparisons between two variables.
  • You can display the equation (y = mx + b) and the R-squared value on the chart itself to show how well the line fits your data.
  • The regression line appears immediately after you select it; you can delete it by right-clicking the line and choosing Delete.

Step-by-step: Adding a linear trendline to a scatter plot

Start with a chart that already contains your data plotted. Click once on the chart to select it, then right-click directly on one of the data points (a dot, if you are using a scatter plot). A menu will appear with several options.

Look for "Add Trendline" in that menu and click it. A panel will open on the right side of your screen titled "Trendline Options". Under "Trendline Options", you will see several choices: Exponential, Linear, Logarithmic, Polynomial, Power, and Moving Average. Select "Linear" — this is the standard regression line.

Once you select Linear, the line appears on your chart immediately. You can now close the Trendline Options panel, or you can stay in it to add the equation and R-squared value to your chart (see the next section).

Display the equation and R-squared value on your chart

While the Trendline Options panel is still open, scroll down to find two checkboxes: "Display Equation on chart" and "Display R-squared value on chart". Check both boxes if you want to see them.

The equation appears in the form y = mx + b, where m is the slope (how steep the line is) and b is the y-intercept (where the line crosses the vertical axis). The R-squared value ranges from 0 to 1 and tells you how closely the line matches your actual data — a value of 1 means the line passes through every point perfectly, while 0.5 means the line captures only half the pattern in your data.

You can click and drag the equation and R-squared text to move them to a clearer spot on your chart if they overlap your data.

Understand what the regression line shows

The regression line summarizes the relationship between two variables. If you plot sales on the vertical axis and advertising spending on the horizontal axis, the regression line shows whether higher spending tends to produce higher sales, and by how much.

The line does not prove that one variable causes the other — it only shows the trend. A rising line means the two variables move together; a flat line means they do not appear related; a falling line means they move in opposite directions. The R-squared value tells you whether that trend is strong enough to be useful for prediction.

Remove or modify a regression line

To delete a regression line, right-click directly on the line itself (not on a data point) and select "Delete". The line disappears immediately, but your data remains unchanged.

To change the line style, color, or other properties, right-click the line and select "Format Trendline". A panel opens where you can adjust the line width, color, dash style, and transparency. You can also change the trendline type here if you decide Linear was not the right choice — for example, switching to Polynomial if your data curves rather than following a straight path.

When to use other trendline types

Linear is the most common choice and works well when your data roughly follows a straight path. If your data curves upward or downward, a Polynomial trendline (usually set to degree 2) may fit better. If your data rises or falls sharply at first and then levels off, an Exponential or Logarithmic trendline may be more appropriate.

You can test different types by selecting each one and comparing their R-squared values — the higher the R-squared, the better the fit. Most business and scientific data uses Linear, so start there unless you have a clear reason to try something else.

Frequently Asked Questions

Can I add a regression line to a chart I did not create?

Yes. Click the chart to select it, then follow the same steps. The chart does not have to be new — as long as it contains plotted data, you can add a trendline to it.

What does R-squared tell me about my data?

R-squared shows how well the regression line fits your data. An R-squared of 0.8 or higher usually means the line is a good summary of the trend. Below 0.5 suggests the line does not capture the pattern well, and you may need a different trendline type or your data may not follow a clear trend.

Can I add multiple regression lines to the same chart?

Yes. If your chart has multiple data series (for example, sales data for two different products), you can add a separate trendline to each one. Right-click each data series individually and add its own trendline.

Does the regression line change if I update my data?

Yes. Excel recalculates the trendline automatically whenever you change the underlying data. The line will shift to match the new trend.