Formualizer Docs
ReferenceFunctionsStatistics Functions

LINEST

LINEST: Returns linear-regression coefficients and optional fit statistics.

Summary

LINEST fits a straight line to known y/x pairs and returns either [slope, intercept] or a larger statistics matrix.

Remarks

  • known_y is required; known_x defaults to 1..n when omitted.
  • const controls whether an intercept is fitted (TRUE by default).
  • stats=TRUE returns a 5x2 result block; otherwise it returns 1x2.
  • Returns spreadsheet errors for mismatched lengths, empty data, or degenerate x-values.

Examples

Slope and intercept only
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
[[2,0]]
Linear fit with non-zero intercept
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
[[2,1]]

Runtime metadata

Category

Statistics

Signature

LINEST(arg1…: Number (Range))

This function accepts a repeating argument pattern (min args: 1).

Arity

min 1, max variadic

Arguments

arg1

Number · Range · coercion NumberLenientText

Caps

PURENUMERIC_ONLY

Source

On this page