Excel LINEST Function

Syntax

=LINEST(known_ys; [known_xs]; [const]; [stats])

What is the LINEST function?

LINEST is one of Excel's most powerful statistical functions. Its Turkish name is DOT, and it computes linear regression using the least squares method, returning statistical parameters as an array. With one formula, you can obtain the slope, intercept, R², F-statistic, regression degrees of freedom, and more.

In data science, finding the parameters of "y = mx + b" is done with LINEST. The function isn't limited to single-variable cases; it also handles multiple linear regression (with multiple independent variables). So if you want to predict sales from advertising spend, season, and price (3 variables), LINEST does it all in a single formula.

LINEST Syntax

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

  • known_y's: (Required) The dependent variable values (actual y values).
  • known_x's: (Optional) The independent variable values. If omitted, 1, 2, 3, ... is assumed.
  • const: (Optional) TRUE = intercept b is calculated (default), FALSE = b is forced to 0.
  • stats: (Optional) TRUE = additional statistics (R², F, etc.) returned, FALSE = only slope and intercept (default).

What LINEST Does — Practical Use Cases

1. Sales Trend Analysis

To find the slope of the trend line in monthly sales: =LINEST(B2:B13,A2:A13) returns the average monthly increase from January to December. A positive slope means growth; negative means decline.

2. Price Elasticity Calculation

For modeling the price-demand relationship in economics: =LINEST(LN(demand),LN(price)). The slope from the log-transformed values is directly the price elasticity coefficient.

3. Quality Control — Process Monitoring

Track the relationship between time and defect count in a production line. If LINEST yields a significantly positive slope, the line needs adjustment.

4. Budgeting — Multi-Factor Model

To model operational cost based on staff count, material amount, and machine hours: =LINEST(cost,staff:material:machine_hours,TRUE,TRUE). The output array contains separate coefficients for each variable plus R², F, and other statistics.

5. Scientific Data Analysis

LINEST is essential for finding calibration curve coefficients in lab data. Modeling the linear relationship between an instrument's reading and the true value yields the "calibration equation."

Advanced Usage Techniques

Reading the Output Array Correctly

LINEST returns an array structured as follows (variables right-to-left):

  • Row 1: Slope(m_n) ... Slope(m_1) Intercept(b)
  • Row 2: Standard error for each slope + standard error for intercept
  • Row 3: R² (coefficient of determination) and standard error of y
  • Row 4: F-statistic and degrees of freedom
  • Row 5: Regression sum of squares and residual sum of squares

To extract a single value, wrap with INDEX: =INDEX(LINEST(y,x,TRUE,TRUE),3,1) returns R².

Comparison with SLOPE and INTERCEPT

SLOPE and INTERCEPT are simpler for single values. But LINEST returns both — and many more statistics — at once. For multi-variable scenarios, LINEST is mandatory; SLOPE only handles single variables.

Entering as an Array Formula

Before Excel 365, LINEST results required Ctrl+Shift+Enter to spill across all cells. In Excel 365, dynamic arrays make this automatic — just press Enter.

Common Mistakes and How to Fix Them

The most frequent LINEST issue is mismatched y and x array sizes. Providing 12 months of y data but 11 months of x data raises a #REF! error. Another common error is setting const incorrectly; FALSE forces the intercept to zero, which can distort the regression. A third typical issue: setting stats=TRUE but not selecting enough cells — LINEST outputs 5 rows × (n+1) columns, and you need to select an area covering this.

Performance and Version Compatibility

LINEST works in Excel 2003 and all later versions. Microsoft 365, Excel for Web, and Excel for Mac fully support it. Performance is instant for small datasets and sub-second for thousands of rows. Matrix operations get more expensive as variables increase, but it handles up to 50 variables smoothly.

Related Functions

  • SLOPE: Returns only the linear regression slope.
  • INTERCEPT: Returns only the intercept.
  • RSQ: Computes the coefficient of determination (R²).
  • FORECAST: Predicts a new y value based on known data points.
  • LOGEST: Exponential regression (the curved counterpart of LINEST).

Conclusion

LINEST is one of Excel's most comprehensive statistical functions. From single-variable trend analysis to multivariate regression, calibration curves, and prediction models, it shines across many domains. Once you understand its output array structure, you can grab all regression statistics from a dataset in one formula and pull the piece you need with INDEX. Anyone serious about data analysis should learn LINEST.

Examples

# Title Formula Result
1 Eğim hesabı =İNDİS(DOT(B2:B13;A2:A13);1;1) 0.85
2 Kesişim =İNDİS(DOT(B2:B13;A2:A13);1;2) 12.3
3 R² değeri =İNDİS(DOT(y;x;DOĞRU;DOĞRU);3;1) 0.92
4 F-istatistiği =İNDİS(DOT(y;x;DOĞRU;DOĞRU);4;1) 124.5
5 Tüm matriks =DOT(B2:B100;A2:A100;DOĞRU;DOĞRU) 5x2 dizi
6 Çoklu değişken =DOT(C2:C50;A2:B50) 1x3 dizi
7 Sabit yok =DOT(y;x;YANLIŞ) sabit=0
8 Logaritmik =DOT(LN(B2:B13);LN(A2:A13)) esneklik

Common Errors

#BAŞV!
Cause: y ve x dizilerinin boyutları uyuşmuyor
Solution:
#DEĞER!
Cause: y veya x dizisinde metin/boş hücre var
Solution:
#SAYI/0!
Cause: Tüm x değerleri aynı (sıfır varyans)
Solution:
Yanlış sonuçlar
Cause: sabit=YANLIŞ verildi ama veriler kesişim ister
Solution:

Frequently Asked Questions

DOT ile EĞİM arasındaki fark?
EĞİM sadece eğimi verir; DOT eğim, kesişim ve istatistikler dahil tüm regresyon parametrelerini bir dizi olarak döndürür.
Çoklu doğrusal regresyon yapabilir mi?
Evet, x parametresine birden fazla sütun verebilirsiniz: <code>=DOT(y;A:B:C)</code>.
Ctrl+Shift+Enter gerekir mi?
Excel 365'te hayır (dinamik diziler). Eski sürümlerde dizi formülü olarak girilmesi gerekir.
R² nasıl alınır?
istatistikler=DOĞRU ile çağırın, sonra <code>İNDİS(...,3,1)</code> R² verir.
sabit=YANLIŞ ne zaman kullanılır?
Teorik olarak doğrunun orijinden geçmesi gerektiğinde (fizik kuralı, doğrudan oran).
Hangi sürümler destekler?
Excel 2003 ve sonrası, M365, Excel for Web, Mac.
Example Excel File
LINEST.xlsx · 22.9 KB

Enter your email to receive the example Excel file (link valid 24h).

Become a supporter — download instantly, no email

Related Functions