Arte SheetsLearn. Try. Understand.

Statistical

SLOPE function: estimate variable cost per unit or trend rate of change

Calculate ordinary least-squares linear slope (change in Y per unit of X) using SLOPE—without reversing the Y and X arguments.

Put known_y's FIRST and known_x's SECOND

The #1 mistake with SLOPE(known_y's, known_x's) is passing X before Y. Because slope measures ΔY / ΔX (dollars per unit, revenue per month), the dependent outcome column (TotalCost in B2:B5) goes first and the driver column (Units in A2:A5) goes second.

Reversing the arguments fits X against Y instead. In this perfectly linear example the result is the reciprocal, but that reciprocal relationship does not generally hold for noisy observations.

UnitsProduced (A)TotalCost (B)
10650
20800
30950
401100

Extract marginal cost per unit

Each 10-unit step adds $150 to TotalCost, so SLOPE(B2:B5, A2:A5) returns exactly $15 per unit.

=SLOPE(B2:B5, A2:A5)

Zero X variance returns #DIV/0!

If every X value is identical, ΔX variance is zero (a vertical line) and SLOPE returns #DIV/0!.

=SLOPE(B2:B5, {10;10;10;10})

Try the example

Use the original values or change them to test your understanding.

Further reading