EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • Featured Skills
    • New & Trending
    • Fresh Entries
    • Finance
    • Data Science
    • Programming and Dev
    • Excel
    • Marketing
    • HR
    • PDP
    • VFX and Design
    • Project Management
    • Exam Prep
    • All Courses
  • Blog
  • Enterprise
  • Free Courses
  • Log in
  • Sign Up
Home Excel Excel Resources Statistical Functions in Excel SLOPE Function in Excel
 

SLOPE Function in Excel

Jeevan A Y
Article byJeevan A Y
Madhuri Thakur
Reviewed byMadhuri Thakur

Updated May 4, 2023

SLOPE Function in Excel

 

 

SLOPE Function in Excel

SLOPE Function is a statistical function in Excel. SLOPE Function calculates the slope of a line generated by linear regression. In Excel, Slope is calculated by considering the data points on a straight line called Known Xs and Known Ys. A straight line equation is formed by using Slope and Intercept, where Slope is the ratio of rise and run, which are anywhere in the straight line. For example, we have created a straight line using some values, and we need to find the Slope of that using a few or all the used values; this is done using the Slope function.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

Before going to a brief introduction on the SLOPE Function in Excel, let us discuss what SLOPE is?

What is the SLOPE of a Line?

The slope of a line is nothing but the Steepness of the line. The slope of a straight line shows how steep the line is. “The steeper the line, the larger the slope”.

Now, look at the below lines.

slope function in excel Lines

Each of the above lines represents the money in the bank account over a period.

Line 1: This line is going up. That means the amount of money in this bank account increases over time.

Line 2: This line is going down. That means the amount of money in this bank account decreases over time.

Line 3: This horizontal straight line neither goes up nor comes down. This is a steady line, and the amount of money remains constant.

Line 4: This line is also going up like the first line. But this line seems to be going up faster than the first line. This line looks steeper than the first one. This bank account’s money is increasing faster because of the steeper line.

What if we want to be specific about how we describe this steepness. SLOPE is described as the steepness of the line.

SLOPE = RISE / RUN

RISE is the vertical change & RUN is the horizontal change.

SLOPE Function line formula

To fund the SLOPE, we take the “change in rise over a change in run”.

Examples of SLOPE:

Example 1: Look at the below graph.

SLOPE Example 1

Slope of the line = 4/4 = 1

Example 2: Look at the below graph.

SLOPE Example 2

Slope of the line = 6/2 = 3

Example 3: Look at the below graph.

SLOPE Example 3

Slope of the line = 3/6 = 0.5

Example 4: Look at the below graph.

SLOPE Example 4

Slope of the line = -4/2 = -2

SLOPE Formula in Excel:

Below is the SLOPE Formula in Excel :

slope function Formula in Excel

SLOPE Formula includes two arguments:

  • Known_y’s: This is a range of cells of numeric dependent values.
  • Known_x’s: This is a range of cells of independent numeric values.

The length of the Known_y’s should be the same as that of the Known_x’s, but the variance should not be zero.

How to Use the SLOPE Function in Excel?

SLOPE Function in Excel is very simple and easy to use. Let us now see how to use this SLOPE Function in Excel with the help of some examples.

You can download this SLOPE Function Excel Template here – SLOPE Function Excel Template

Example #1

In this example, I have two sets of values (Known_y’s and Known_x’s). Calculate the slope of these two ranges using the SLOPE function in Excel.

slope function in excel Example 1-1

Apply the SLOPE Function to get the slope value of the line.

SLOPE Example 1-2

So the result will be :

SLOPE Example 1-3

Insert graph for it.

SLOPE Example 1-4

Example 2: We can directly enter the values into the formula itself but with curly brackets. Below images are examples of it.

Picture 1

SLOPE Example 2-1

So the result will be :

SLOPE Example 2-2

Picture 2

SLOPE Example 2-3

So the result will be :

SLOPE Example 2-4

SLOPE as VBA Function

Below is the code for running macro for SLOPE Function :

Sub SLOPE_Example()

Step 1: Declare variables

Dim Known_X As Range

Dim Known_Y As Range

Step 2: Set the object variables

Set Known_X = Range(“A2:A7”)

Set Known_Y = Range(“B2:B7”)

Step 3: Show the result in Message Box

MsgBox Application.WorksheetFunction.Slope (Known_Y, Known_X)

End Sub

Things to Remember

  • Both the parameters should be of the same length. For example, if Known_y’s range is A2: A10, then Known_x’s values should be in the same length range.
  • Both arguments can accept only numerical values; if there are text or string values, then it excludes those values. The arguments can contain numbers or names that contain numbers.
  • Both arguments should not be empty; if any one of the ranges is empty, then the result will be #DIV/0!
  • A variance of the two arguments should not be zero. If the variance is zero, then we will get #DIV/0!
  • Learn the basics of SLOPE to understand the working method of SLOPE in Excel.

This has been a guide to the SLOPE Function in Excel. Here we discuss the SLOPE Formula in Excel and how to use the SLOPE Function in Excel, along with practical examples and downloadable Excel templates. You can also go through our other suggested articles –

  1. SUM Function in Excel
  2. LEN Function in Excel
  3. EVEN Excel Function
  4. Logical Functions in Excel

Primary Sidebar

Footer

Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA

Download SLOPE Function Excel Template

EDUCBA
Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

EDUCBA

Download SLOPE Function Excel Template

EDUCBA

डाउनलोड SLOPE Function Excel Template

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

🚀 Limited Time Offer! - ENROLL NOW