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.
Syntax
| Argument | Description | |
|---|---|---|
known_ys | Required | The array or range of dependent (y) data points. |
known_xs | Required | The 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 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
Pick a SLOPE example to see the formula and its result.
Practice workbook
Frequently asked questions
What does SLOPE return?
Why does swapping the arguments change the result?
How do I build the full regression line?
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?
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