How to find the slope of a line in Excel

You can watch a video tutorial here.

Excel is widely used for mathematical operations due to the variety of functions and tools it provides. It also has several options for creating and formatting charts. If you have a trendline, you may need to find the slope of the line. In Excel, there are 3 ways of doing this:

  1. Use the equation on the trendline
  2. Use the SLOPE() function: this returns the slope of a line
    1. Syntax: SLOPE(known-y’s, known-x’s)
      1. known-y’s: the range of the y values
      2. known-x’s: the range of the x values
  3. Use the mathematical formula to calculate the slope (m)
    1. m = change in y coordinates/change in x coordinates

Option 1 – Use the equation

Step 1 – Open the Format Trendline menu

  • Select the chart and/or the line
  • Go to Chart Design > Add Chart Element > Trendline > More Trendline Options

Step 2 – Select the display option

  • In the Format Trendline pane, select Display Equation on chart
  • The equation will be displayed on the chart

Step 3 – Find the value of the slope

  • The slope is the number adjacent to ‘x’

Option 2 – Use the SLOPE function

Step 1 – Create the formula

  • Select the cell where the result is to be displayed
  • Type in the formula using cell references:

=SLOPE(range of y, range of x)

  • Press Enter

Step 2 – Check the result

  • The value matches that in the equation

Option 3 – Use the SLOPE formula

Step 1 – Create the formula

  • Select the cell where the result is to be displayed
  • Type in the formula using cell references:

=(y2-y1)/(x2-x1)

  • Press Enter

Step 2 – Check the result

  • The value matches that derived from the other 2 options