Add a Linear Regression Trendline to an Excel Scatter Plot

by Guy McDowell

You’re either reading this because you searched for how to add a linear regression trendline to an Excel scatter plot or you saw the title and thought, “Are these words even English?!” We’ll help you with both.

Add a Linear Regression Trendline to an Excel Scatter Plot image 1

What Is Linear Regression?

If you know what a linear regression trendline is, skip ahead. Ok, now that the nerds are gone we’ll explain linear regression. Linear means in a line. You knew that. Regression, in math, means figuring out how much one thing depends on another thing. We’ll call these two things X and Y

Table of Contents

    Let’s use the example of tracking the value of a single share in the stock market over the years. X will be time in years and Y will be the value in dollars. 

    We know that the value of a stock is changed by time passing, among other things. We can’t control those other things, but we can control when we sell the stock, so we control the time variable. But how dependent is the value of a stock on time passed?

    If we bought a stock for $1 and in one year its value went up to $100, does that mean every year the value will go up another $100? Does that mean in 25 years it will be valued at $2500? We don’t know.

    We figure it out by looking at how much the stock earned over several years. That’s fairly simple because we’re only measuring how much we change one thing or one variable. Then we put those measurements on a graph or plot. The dots could be all over the place or scattered

    Could we draw a line through the dots that would show a trend? Let’s call that a trendline. Yes, we can certainly try. That line is a simple linear regression trendline through a scatter plot. Now we know those words are actually English and what they mean. Let’s create one in Excel.

    How To Create An Excel Scatter Plot With Linear Regression Trendline

    Let’s assume you haven’t learned all about Excel yet. The first step is to create a scatter plot. Then we can create the trendline. Then we can do some neat things with the trendline and see what it means.

    Time (Yrs)Stock Value ($)
    20001498
    20011160
    20021147
    2003848
    20041126
    20051180
    20061294
    20071420
    20081322
    2009797
    20101169
    20111325
    20121408
    20131569
    20141872
    20152067
    20162059
    20172362
    20182640
    20192834
    20202584

    What Does The Equation and R-squared Value Mean?

    These are handy to have. The R-squared value tells you just how good the trendline fit is. Although an R-squared value above 0.8 is ideal, 0.69 isn’t bad though. Think of it as you being 69% confident that this line will give you a good insight into how this stock tends to perform.

    The equation makes it easier for you to do quick calculations to figure out what the stock value on the trendline is at any point in time. Even before the line begins and after it ends. What might the stock be worth in 2030? Let’s plug it into the equation.

    Y = 80.468 x X – 160136 – where X is 2030

    Y = 80.468 x 2030 – 160136

    Y = 163,350.04 – 160136

    Y = 3,214.04

    Yes, if the trend holds, the value of the stock has a decent chance of being worth $3214.04 in 2030.

    What Will You Do With A Linear Regression Trendline?

    We’ve shown you an example of how a linear regression trendline in Excel might help you make a financial decision. But what other ways could you use it? Are you coming up with ideas? Let us know.

    Exit mobile version