Return to List of Excel Functions

SLOPE Function Examples in Excel, VBA, & Google Sheets

Download Example Workbook

Download the example workbook

This Excel Tutorial demonstrates how to use the Excel SLOPE Function in Excel to calculate the slope.

SLOPE Main Function

Slope Function Overview

The Slope Function Calculates the slope of a line generated past linear regression.

To apply the SLOPE Excel Worksheet Function, select a cell and blazon:

slope formula syntax

(Find how the formula inputs appear)

SLOPE Role Syntax and inputs:

=Slope(known_ys,known_xs)

known_y'southward – An array of known Y values.

known_x'south – An assortment of known Ten values.

What is Gradient?

The Slope function in Excel is used to summate the slope of a line given known x and y values.

The Gradient function can exist used in conjunction with the INTERCEPT function to notice the equation of a linear line,

y = a + bx

Suppose I have a table of data with x and y values:

SLOPE Function EX01

The slope of a line is calculated by plotting the data and using the

SLOPE Formula EX01

method, demonstrated below:

SLOPE Function EX02

Using the above chart, we can calculate the slope, b using the ascension of the line divided by the run of the line.

SLOPE Formula EX02

Using the SLOPE part:

SLOPE Function EX03

How to use Slope

The SLOPE function takes ii arguments:

=SLOPE(known_y's, known_x's)

Where known_y'southward and known_x'southward refer to the x and y information in your data table.

Using our start example, the part is written as:

=Gradient(B3:B7,C3:C7)

Pairing Gradient and INTERCEPT

To pair Slope and INTERCEPT, an equation can exist written every bit:

= INTERCEPT(B3:B7,C3:C7) + SLOPE(B3:B7,C3:C7) * 10

Interested in More Forecasting?

Pair SLOPE with INTERCEPT to see how to create the equation of a line and visit our other articles on Forecasting with Exponential Smoothing, TREND and LINEST functions.

Gradient role in Google Sheets

The Slope function works exactly the aforementioned in Google Sheets as in Excel.

SLOPE Google Function

Additional Notes

The slop of the regression line is calculated every bit <<<<<<<<<<<>>>>>>>>>>>>>>

Known_y'due south and Known_x'due south must not exist empty and must have the same number of information points.

SLOPE Examples in VBA

You can also employ the Gradient function in VBA. Type:
application.worksheetfunction.slope(known_ys,known_xs)
For the role arguments (known_y's, etc.), you lot can either enter them directly into the office, or define variables to employ instead.

Render to the List of all Functions in Excel