Statistical function

SLOPE function

Returns the slope of the best-fit straight line through your data: how much y changes on average when x rises by one.

Available in All versions of Excel, including Microsoft 365 and Excel for the web

In every Excel versionWorks in Google Sheets

Syntax

SLOPE(known_y's, known_x's)
ArgumentWhat it means
known_y'sRequiredThe dependent values (e.g. cost, sales).
known_x'sRequiredThe independent values (e.g. units, month number), same number of points.

Returns: The slope m of the least-squares line y = mx + b.

How SLOPE works

SLOPE measures a rate of change hidden in noisy data. Give it two columns and it fits the best straight line (least squares) and reports the line's steepness: the average change in y for each one-unit increase in x. Use it to estimate the variable cost per unit produced, how much revenue grows per month, how many extra sales each 1k of advertising brings, or how fast a stock level is falling.

A positive slope means y tends to rise with x, a negative slope that it falls. The units are "y units per x unit", so a slope of 5.85 between cost in euros and units produced reads as €5.85 per extra unit. Combine it with INTERCEPT to write the full line, or let TREND or FORECAST.LINEAR do the prediction. Pairs with text, logicals or blanks are ignored.

Examples

1Variable cost per unit

D2fx=SLOPE(B2:B6, A2:A6)
ABCD
1UnitsTotal cost
210026005.85
32003150
43003800
54004300
65004950

Result: 5.85

Each extra unit adds about 5.85 to total cost. The intercept (2005) is the fixed cost.

2Monthly revenue trend

D2fx=SLOPE(B2:B7, A2:A7)
ABCD
1MonthRevenue (k)
2148.22.53
3250.1
4353.8
5455
6558.9
7660.4

Result: 2.53

Revenue grows by about 2.531429k per month on average (shown to 2 decimals), even though individual months jump around.

3Return on advertising

D2fx=SLOPE(B2:B6, A2:A6)
ABCD
1Ad spend (k)Sales (k)
22415.51
3452
4558
5770
6979

Result: 5.51

5.513699 (shown to 2 decimals): each extra 1k of ad spend goes with about 5.5k more sales in this data. Correlation, not proof of cause.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 15 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe ranges have different numbers of points.Use matching ranges.
#DIV/0!All x-values are identical, or there are fewer than two points.Provide varied x-values.
Wrong sign or sizeThe arguments were given in the order x, y.SLOPE takes y first: =SLOPE(y_range, x_range).

Tips

  • With dates as x, SLOPE returns the change per day; multiply by 30.4 or 365 for per-month or per-year figures.
  • Check the fit with RSQ; a slope from a cloud with R² of 0.1 is not reliable.
  • Chart trendlines show the same slope: right-click the series > Add Trendline > Display equation.

Questions

What does the slope mean in plain words?

It is the average change in y for every 1-unit increase in x. A slope of 2.5 between revenue (k) and month means revenue rises by about 2.5k per month.

Why does SLOPE differ from (last − first)/(periods)?

SLOPE uses every data point to fit the best line, while the simple calculation uses only the first and last points and is sensitive to unusual months.

Google Sheets

SLOPE also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

SLOPE in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishSTIGNING
DutchRICHTING
FinnishKULMAKERROIN
FrenchPENTE
GermanSTEIGUNG
HungarianMEREDEKSÉG
ItalianPENDENZA
Norwegian (Bokmål)STIGNINGSTALL
PolishNACHYLENIE
Portuguese (Brazil)INCLINAÇÃO
Portuguese (Portugal)DECLIVE
RussianНАКЛОН
SpanishPENDIENTE
SwedishLUTNING
TurkishEĞİM