Formualizer Docs

SLOPE

Returns the slope of the linear regression line for paired data.

SLOPE fits y = m*x + b and returns m, the rate of change in y per unit of x.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=SLOPE(known_ys, known_xs)

Arguments

ArgumentTypeRequiredDefault
known_ysnumber (range)Required—
known_xsnumber (range)Required—

Remarks

  • known_y and known_x must have the same numeric length.

Error cases

  • Returns #N/A for mismatched lengths.
  • Returns #DIV/0! if all x values are identical.

Examples

Describe a linear fit between paired x and y observations.

Formula =SLOPE({2,5,6,9},{1,2,3,4})

Expected result 2.2

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Reverse the order of the y series while leaving x unchanged.

Formula =SLOPE({9,6,5,2},{1,2,3,4})

Expected result -2.2

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Evaluate a series whose observations lie exactly on a line.

Formula =SLOPE({2,4,6},{1,2,3})

Expected result 2

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

The known x and y series must contain corresponding observations.

Formula =SLOPE({2,5,6,9},{1,2,3})

Expected result #N/A

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Negative slope from ranges

Formula =SLOPE(A1:A3,B1:B3)

Input cells
AB
1101
282
363

Expected result -2

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Implementation

Engine source

On this page