LINEST Function Explained
The LINEST
Function in Microsoft Excel is used to calculate the statistics for a line by using the least squares method to calculate a straight line that best fits your data. It returns an array that describes the line, including the slope, y-intercept, and the coefficients of the determination (R-squared). It takes up to five arguments: known_y's
, known_x's
, const
, stats
, and m
.
LINEST Function Syntax
LINEST(known_y's, [known_x's], [const], [stats])
- known_y’s: An array or range of dependent data points.
- known_x’s: An optional array or range of independent data points. If this argument is omitted, the function uses the array {1,2,3,…} for the independent data points.
- const: An optional logical value that specifies whether to force the constant b in the equation to equal 0. If this argument is omitted, the constant b is calculated normally.
- stats: An optional logical value that specifies whether to return additional regression statistics. If this argument is omitted, only the m and b coefficients are returned.