LINEST function - Zoho Sheet - Help Guide

LINEST

Returns an array of statistics for a straight line that best fits the given data set.

 

Syntax

 

LINEST(y_values; [x_values]; [allow_const]; [stats])

y_values: The array or range containing the known (or dependent) y values. E.g. A2:A6

x_values: The array or range containing the known (or independent) x values. It must be of the same size as that of y_values. Defaults to {1,2,3...} if omitted. E.g. B2:B6

allow_const: Logical value that determines whether to return the y-intercept values or not. Defaults to 1 if omitted.

TRUE or 1  - returns the y-intercept values

FALSE or 0 - returns the y-intercept as 0

stats: Logical value that determines whether to return additional regression statistics or not. Defaults to 0 if omitted.

TRUE or 1  - returns the additional regression data

FALSE or 0 - ignores the additional regression data

 

 

Statistics Returned

Description

m1,m2,...,mn

The slope of the regression line y=mx+b for the values x1,x2, etc.

b

The y-intercept of the regression line.

se1,se2,...,sen

The standard error values for the slopes m1,m2,...,mn.

seb

The standard error value of the intercept b.

r2

The coefficient of determination.

sey

The standard error of the regression for the y value.

F

The F statistic or F observed value for variance analysis.

df

The degrees of freedom from the variance analysis.

ssreg

The regression sum of squares.

ssresid

The residual sum of squares.

 

Examples

 

Formula

Result

 

=LINEST(A2:A6;B2:B6)

3

-1

=LINEST(A2:A6;B2:B6;1;1)

3

0.2

0.98684210526316

225

90

-1

1

1

3

1.2


Get a hands-on experience of the function in the embedded range below. 



Possible Errors

 

Errors

Meaning

#N/A!

  • The function could not find the value it was asked to look for. Commonly occurs in VLOOKUP and similar functions.

#NAME!

  • The function name is incorrect or invalid.

  • The given defined name (if any) is invalid.

  • There is a typo in the defined name used in the function.

  • Double quotes are missing for text values in the function.

  • Colon missing in a cell range reference.

#VALUE!

  • The given argument's data type is incorrect or invalid.
    For example, the function =DATE(A1:A3) will return a #VALUE error when a text value is present in the range.

#REF!

  • The given cell reference is incorrect or invalid. This error may occur when a cell/range has been deleted, moved, or pasted over.

 

Similar Functions