Home › Functions › Statistical › LINEST
fx
LINEST
Statistical  ·  Since: Excel 2003  ·  9 languages

The LINEST function calculates the statistics for a line by using the "least squares" method to calculate a straight line that best fits your data, and then returns an array that describes the line. You can also combine LINEST with other functions to calculate the statistics for other types of models that are linear in the unknown parameters, including polynomial, logarithmic, exponential, and power series. Because this function returns an array of values, it must be entered as an array formula. Instructions follow the examples in this article.

🌐 Translations

English LINEST
Deutsch RGP
Français DROITEREG
Español ESTIMACION.LINEAL
Italiano REGR.LIN
Português PROJ.LIN
Nederlands LIJNSCH
Polski REGLINP
Русский ЛИНЕЙН

📦 Availability

Excel versionAvailable
Excel 2007 ✓
Excel 2013 ✓
Excel 2019 ✓
Excel 2021 ✓
Microsoft 365 ✓
Translate a formula with this function
fx EN
fx DE

⌨ Syntax

LINEST(known_y's,[known_x's],[const],[stats])

Arguments

known_y's (required) — The set of y-values that you already know in the relationship y = mx + b. If the range of known_y's is in a single column, each column of known_x's is interpreted as a separate variable. If the range of known_y's is contained in a single row, each row of known_x's is interpreted as a separate variable.
known_x's (optional) — A set of x-values that you may already know in the relationship y = mx + b. The range of known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column). If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's .
const (optional) — A logical value specifying whether to force the constant b to equal 0. If const is TRUE or omitted, b is calculated normally. If const is FALSE, b is set equal to 0 and the m-values are adjusted to fit y = mx.
stats (optional) — A logical value specifying whether to return additional regression statistics. If stats is TRUE, LINEST returns the additional regression statistics; as a result, the returned array is {mn,mn-1,...,m1,b;sen,sen-1,...,se1,seb;r 2 ,sey;F,df;ssreg,ssresid} . If stats is FALSE or omitted, LINEST returns only the m-coefficients and the constant b. The additional regression statistics are as follows.

▶ Examples

=LINEST(A2:A5,B2:B5,,FALSE)
=LINEST(E2:E12,A2:D12,TRUE,TRUE)
=LINEST(yvalues,xvalues^COLUMN($A:$C))

Related functions

Copied to clipboard