Returns a table of statistics for a straight line that best fits a data set.
LINEST(yvalues, xvalues, allow_const, stats)
yvalues is a single row or column range specifying the y coordinates in a set of data points.
xvalues is a corresponding single row or column range specifying the x coordinates. If xvalues is omitted it defaults to 1, 2, 3, ..., n. If there is more than one set of variables xvalues may be a range with corresponding multiple rows or columns.
LINEST finds a straight line that best fits the data, using linear regression (the "least squares" method). With more than one set of variables the straight line is of the form .
if allow_const is FALSE the straight line found is forced to pass through the origin (the constant a is zero; ). If omitted, allow_const defaults to TRUE (the line is not forced through the origin).
to are the line gradients; a is the y-axis intercept.
to are the standard error values for the line gradients; is the standard error value for the y-axis intercept.
is the determination coefficient RSQ; is the standard error value for the y estimate.
F is the F statistic (F-observed value); df is the number of degrees of freedom.
is the regression sum of squares; is the residual sum of squares.