SLOPE function
SLOPE returns the slope of the best-fit straight line through your data, showing how much y changes for each one-unit rise in x. For example, it can show extra sales per extra ad dollar.
Example
Read it as a sentence: find the slope of the best-fit line through the G1:G5 values against the F1:F5 values, which gives 0.6.
Excel shows 0.6
F
G
1
1
2
2
2
4
3
3
5
4
4
4
5
5
5
Data
Syntax
SLOPE(known_y's, known_x's)
-
known_y's(required) - The dependent values.
-
known_x's(required) - The independent values.
Returns: The slope of the best-fit straight line.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=SLOPE({2,4,5,4,5},{1,2,3,4,5}) | 0.6 | Array constants |
=SLOPE(Data!G1:G5,Data!F1:F5) | 0.6 | Two ranges (y,x order as written) |
=SLOPE(Data!I1:I5,Data!H1:H5) | 0.75 | Blank and text-number pairs dropped |
=SLOPE(Data!G1:G2,Data!F1:F2) | 2 | Two pairs |
=SLOPE({2,4,5,4,5},Data!F1:F5) | 0.6 | Row vs column same count |
=SLOPE(Data!G1:G5,Data!K1:K3) | #N/A | Different sizes |
=SLOPE(Data!G1:G5,Data!J1:J5) | #DIV/0! | Constant x |
=SLOPE(Data!C1:C5,Data!F1:F5) | #N/A | Range containing #N/A |
The Data sheet these formulas read
A cell that starts with = holds that formula.
C
F
G
H
I
J
K
1
1
1
2
1
2
3
1
2
2
2
4
4
3
2
3
=NA()
3
5
3
5
3
3
4
4
4
4
4
4
3
5
5
5
5
5
5
3
Data
Watch out for
- Argument order is y first, then x.
- Different array sizes give #N/A.
Where it works
- Excel
- SLOPE is in every version of Excel from 2007 on.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Statistical functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .