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)| Argument | What it means | |
|---|---|---|
known_y's | Required | The dependent values (e.g. cost, sales). |
known_x's | Required | The 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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Units | Total cost | ||
| 2 | 100 | 2600 | 5.85 | |
| 3 | 200 | 3150 | ||
| 4 | 300 | 3800 | ||
| 5 | 400 | 4300 | ||
| 6 | 500 | 4950 |
Result: 5.85
Each extra unit adds about 5.85 to total cost. The intercept (2005) is the fixed cost.
2Monthly revenue trend
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | Revenue (k) | ||
| 2 | 1 | 48.2 | 2.53 | |
| 3 | 2 | 50.1 | ||
| 4 | 3 | 53.8 | ||
| 5 | 4 | 55 | ||
| 6 | 5 | 58.9 | ||
| 7 | 6 | 60.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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Ad spend (k) | Sales (k) | ||
| 2 | 2 | 41 | 5.51 | |
| 3 | 4 | 52 | ||
| 4 | 5 | 58 | ||
| 5 | 7 | 70 | ||
| 6 | 9 | 79 |
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.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | The 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 size | The 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.
| Language | Function name |
|---|---|
| Danish | STIGNING |
| Dutch | RICHTING |
| Finnish | KULMAKERROIN |
| French | PENTE |
| German | STEIGUNG |
| Hungarian | MEREDEKSÉG |
| Italian | PENDENZA |
| Norwegian (Bokmål) | STIGNINGSTALL |
| Polish | NACHYLENIE |
| Portuguese (Brazil) | INCLINAÇÃO |
| Portuguese (Portugal) | DECLIVE |
| Russian | НАКЛОН |
| Spanish | PENDIENTE |
| Swedish | LUTNING |
| Turkish | EĞİM |