How to make a linear regression graph in Excel

Lesson 25/26 | Study Time: 0 Min

If you need to quickly visualize the relationship between the two variables, draw a linear
regression chart. That's very easy! Here's how:


1. Select the two columns with your data, including headers.

2. On the Inset tab, in the Chats group, click the Scatter chart icon, and select the Scatter
thumbnail (the first one):



This will insert a scatter plot in your worksheet, which will resemble this one:



3. Now, we need to draw the least squares regression line. To have it done, right click on
any point and choose Add Trendline… from the context menu. 




4. On the right pane, select the Linear trendline shape and, optionally, check Display
Equation on Chart
to get your regression formula:



As you may notice, the regression equation Excel has created for us is the same as the
linear regression formula we built based on the
Coefficients output.



5. Switch to the Fill & Line tab and customize the line to your liking. For example, you can
choose a different line color and use a solid line instead of a dashed line (select Solid line
in the Dash type box): 




At this point, your chart already looks like a decent regression graph:

Still, you may want to make a few more improvements:

-Drag the equation wherever you see fit.

-Add axes titles (Chart Elements button > Axis Titles).

-If your data points start in the middle of the horizontal and/or vertical axis like in this
example, you may want to get rid of the excessive white space. The following tip
explains how to do this:
Scale the chart axes to reduce white space.



And this is how our improved regression graph looks like:



Important note! In the regression graph, the independent variable should always be on
the X axis and the dependent variable on the Y axis. If your graph is plotted in the reverse
order, swap the columns in your worksheet, and then draw the chart anew. If you are not
allowed to rearrange the source data, then you can
switch the X and Y axes directly in a
chart
.