Statistical

SLOPE Function in Excel

Returns the slope of the linear regression line.

Syntax

  • =SLOPE(known_y's, known_x's)

Arguments

  • known_y's (required): Dependent data range
  • known_x's (required): Independent data range

Examples

  • =SLOPE(B2:B10, A2:A10) - Slope of trend line - Result: Slope value

Excel SLOPE function documentation

  • SLOPE is a Statistical function that returns the slope (m) of the linear regression line through known_y's and known_x's — the rate of change in Y per unit change in X.
  • Available in Excel 2010 and later on desktop; syntax is =SLOPE(known_y's, known_x's). Both ranges must contain numbers and have the same number of data points.
  • Use SLOPE with INTERCEPT to build y = mx + b, or skip both and use FORECAST.LINEAR for a single prediction on new x values.
  • Related: [INTERCEPT](/functions/intercept/), [FORECAST.LINEAR](/functions/forecast-linear/), [LINEST](/functions/linest/), [RSQ](/functions/rsq/) for R² fit quality.

SLOPE syntax and arguments explained

  • known_y's (required): the dependent variable range — sales, revenue, temperature, or any Y values you want to explain.
  • known_x's (required): the independent variable range — time periods, advertising spend, months, or any X values paired with Y.
  • Both arguments must be the same length. Mismatched sizes return #N/A; text or empty cells in either range can return #VALUE! or #DIV/0!.
  • Example syntax: =SLOPE(B2:B10, A2:A10) where column A holds months 1–9 and column B holds monthly revenue.

Step-by-step: calculate trend slope in Excel

  • Step 1 — Put X values (months, years, units) in one column and matching Y values in the next column on the same rows.
  • Step 2 — Confirm both columns are numbers (not text). Use VALUE or multiply by 1 if green triangles appear.
  • Step 3 — Enter =SLOPE(Y_range, X_range) using the full data block, e.g. =SLOPE(C2:C25, B2:B25).
  • Step 4 — Interpret: slope 1500 on monthly revenue vs month means revenue rises $1,500 per month on average along the best-fit line.
  • Step 5 — Validate with a scatter chart trendline or =RSQ(Y_range, X_range) near 1 for a strong linear fit.

SLOPE vs LINEST vs chart trendline

  • SLOPE returns only the slope coefficient — best when you need m for one formula or dashboard tile.
  • LINEST returns slope, intercept, and optional regression statistics in an array — use for full model diagnostics.
  • Chart trendline displays slope visually; use SLOPE when the workbook must stay formula-driven without charts.
  • FORECAST.LINEAR(x, known_y's, known_x's) predicts Y for a new X without manually combining SLOPE and INTERCEPT.

Worked examples to copy

  • Annual growth rate: X = years {2019,2020,2021,2022,2023}, Y = revenue — =SLOPE(revenue, years) gives dollars per year.
  • Unit economics: X = units sold, Y = total cost — slope approximates marginal cost per additional unit (linear assumption).
  • Monthly trend: X = 1..12 for Jan–Dec, Y = monthly KPI — multiply slope by 12 for a rough annualized change on monthly data.
  • Combine with INTERCEPT: predicted Y = =SLOPE(B:B,A:A)*D2 + INTERCEPT(B:B,A:A) for any new X in D2.

People also ask

  • What is the Excel SLOPE function? — It calculates the slope of the least-squares regression line through two data sets.
  • What is the syntax for SLOPE in Excel? — =SLOPE(known_y's, known_x's) with equal-length numeric ranges.
  • Can SLOPE handle negative trends? — Yes. A negative slope means Y decreases as X increases.
  • Why does SLOPE return #DIV/0!? — Usually only one data point, zero variance in X, or all identical X values.

Common errors

  • Arrays must be same size

Use cases

  • Trend analysis
  • Rate of change
  • Regression analysis

Frequently asked questions

  • What does the slope value mean? Slope tells you how much Y changes for each unit increase in X. A slope of 2.5 means Y increases by 2.5 for every 1 unit increase in X. Negative slope means Y decreases as X increases.
  • How do I build a complete regression equation? The equation is Y = SLOPE*X + INTERCEPT. Calculate both: =SLOPE(Y_range, X_range) and =INTERCEPT(Y_range, X_range). Then predict: =SLOPE(...)*new_X + INTERCEPT(...), or just use FORECAST.LINEAR.
  • How do I calculate the rate of change per year? If X is years and Y is values, SLOPE gives you the annual rate of change. For monthly data, multiply by 12 for annual rate. For percentage growth rate, divide slope by average Y value and multiply by 100.

Editorial review

  • Reviewed by Excel.Directory Editorial Team. Updated May 2026.

When to use SLOPE

  • Trend analysis — common Statistical scenario for SLOPE.
  • Rate of change — common Statistical scenario for SLOPE.
  • Regression analysis — common Statistical scenario for SLOPE.

SLOPE in the Statistical category

  • Browse all Statistical functions at /categories/statistical/ for related formulas.
  • SLOPE syntax: =SLOPE(known_y's, known_x's)
  • known_y's (required): Dependent data range
  • known_x's (required): Independent data range
  • Confirm SLOPE arguments match the syntax shown above before filling down.
  • Lock table and range references with $ when copying formulas across rows or sheets.

Formula checklist before you copy down

  • Confirm SLOPE arguments match the syntax shown above before filling down.
  • Lock table and range references with $ when copying formulas across rows or sheets.
  • If results look wrong, check for text stored as numbers and invisible spaces with TRIM.
  • Spot-check three known input rows manually against expected output.

Related Excel functions

  • INTERCEPT (/functions/intercept/): Returns the y-intercept of the linear regression line.
  • FORECAST.LINEAR (/functions/forecast-linear/): Calculates a future value using linear regression.
  • LINEST (/functions/linest/): Returns the parameters of a linear trend using least squares method.

Errors to watch for

  • Arrays must be same size — review causes on linked error pages in the directory.

Copy-paste audit workflow

  • Enter SLOPE on three test rows with known expected output documented on a QA tab.
  • Fill down only after absolute references are locked on lookup tables and rate tables.
  • Compare against manual calculation or a calculator for financial and statistical functions.
  • Search this directory for comparison guides when choosing between similar functions in the same category.

SLOPE worked examples to copy

  • =SLOPE(B2:B10, A2:A10) — Slope of trend line. Expected result: Slope value.

SLOPE reference summary for crawlers and offline review

  • SLOPE belongs to the Statistical category in Excel. Returns the slope of the linear regression line.
  • Full syntax: =SLOPE(known_y's, known_x's). Open /functions/slope/ for parameters, FAQs, and related pages.
  • Common mistakes: Arrays must be same size
  • Pair this function with comparison guides when another Excel formula might fit the same task better.
  • Review fix-excel-formula-errors when unexpected errors appear after upgrading Excel or sharing across locales.