How to Make Excel Calculate the Graph's Slope

••• Rawpixel/iStock/GettyImages

The slope of a graph gives you valuable information about the relationship between the two variables that were graphed. Essentially, the slope describes how much the "y" variable (on the vertical axis) moves per unit change in the "x" variable (the horizontal axis). Once you enter your data into an Excel spreadsheet, the program can produce a scatter plot graph, which is a useful tool for visualizing your numbers. Following that, you can have Excel calculate the equation for the best straight line through the graph. This equation will include the slope.

Creating a Scatter Plot

    Open a new Excel file and, in a fresh worksheet, enter your "x" data as a series of numbers going downwards in a single column. The x values on a graph are normally the ones which you can control or vary. For example, if you were plotting the relationship between hours of sleep per night and students' school grades, the hours of sleep would be the x data.

    Enter the "y" data as a vertical series of numbers in a single column immediately to the right of the "x" column. There should be one y value paired with each x value. In the example of students' sleep, the school grades would be the y data.

    Position the mouse cursor over the left uppermost data point in your two columns. Hold down the left mouse button and drag the cursor to the bottom right data point. Release the button. Your entire data series should be highlighted.

    Left click on the "Insert" tab on the upper Excel menu. A banner of options will open along the top of the window. In the "Chart" section, click the icon labeled "Scatter" and then select the icon labeled "Scatter with only Markers." Excel will create a scatter plot graph of your data and display it as an overlay on the worksheet.

Finding the Slope

    Right click the mouse on any of the data points on your scatter plot. A window of options will appear. Click on the option labeled "Add trendline..." A new window of options will appear.

    Check the box labeled "Display Equation on Chart" and then close the window.

    Examine the equation for the line, which Excel is now displaying overlaid on the scatter plot. The equation will be in the form of "y = mx + b" where m and b will be numbers. The value of "m" is the slope of the graph. For example, if the equation is y = 5.2x + 7, the slope is 5.2.

    Things You'll Need

    • Computer
    • Microsoft Excel software


    • It is possible for the slope to be a negative number. This means that the straight line in your graph travels downwards from left to right rather than upwards.


About the Author

Michael Judge has been writing for over a decade and has been published in "The Globe and Mail" (Canada's national newspaper) and the U.K. magazine "New Scientist." He holds a Master of Science from the University of Waterloo. Michael has worked for an aerospace firm where he was in charge of rocket propellant formulation and is now a college instructor.