SLOPE Function

Excel Functions › Statistical

All versions Statistical

The Excel SLOPE function returns the slope of the linear regression line through a set of paired data points — the change in y for each one-unit change in x.


Quick answer:
=SLOPE({2,3,9,1,8},{6,5,11,7,5}) slope of the best-fit line =~ 0.669

Syntax

=SLOPE(known_ys, known_xs)
ArgumentDescription
known_ysRequiredThe array or range of dependent (y) data points.
known_xsRequiredThe array or range of independent (x) data points. Must have the same count as known_ys.

How to use it

SLOPE fits a straight line through your data using least-squares regression and returns its slope — the rise over run, or how much y changes per unit of x.

=SLOPE({1,2,3,4,5},{2,4,6,8,10}) // y = 0.5x, slope = 0.5
=SLOPE({2,3,9,1,8},{6,5,11,7,5}) // best-fit slope =~ 0.669

SLOPE pairs with INTERCEPT to define the full regression line y = slope·x + intercept, and with RSQ to judge how well that line fits. The two arrays must have the same number of points.

Watch the argument order: known_ys comes first, known_xs second — the reverse of how you might read “x then y”. Swapping them changes the result.

Try it: interactive demo

Live demo

Pick a SLOPE example to see the formula and its result.

Result:

Practice workbook

📊
Download the free SLOPE practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

What does SLOPE return?
The slope of the least-squares regression line through your paired data — how many units y changes for each one-unit increase in x.
Why does swapping the arguments change the result?
SLOPE is not symmetric: known_ys must come first and known_xs second. Regressing y on x gives a different slope than regressing x on y, unlike CORREL or RSQ which are order-independent.
How do I build the full regression line?
Combine SLOPE and INTERCEPT: y = SLOPE(ys,xs)*x + INTERCEPT(ys,xs). FORECAST or TREND can do the prediction in one step.
What if the arrays are different sizes?
SLOPE returns an N/A error. The two arrays must contain the same number of numeric points. If x has zero variance, it returns a divide error.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: INTERCEPT · RSQ · CORREL · FORECAST · STEYX