Statistical

LINEST Function in Excel

Returns the parameters of a linear trend using least squares method.

Syntax

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

Arguments

  • known_y's (required): Dependent values
  • known_x's (optional): Independent values
  • const (optional): TRUE to calculate intercept
  • stats (optional): TRUE to return additional statistics

Examples

  • =LINEST(B1:B10, A1:A10) - Linear regression - Result: Slope and intercept

LINEST for data analysis

  • Confirm whether you need entire columns, filtered subsets, or distinct values.
  • Use [COUNTIFS](/functions/countifs/) and [SUMIFS](/functions/sumifs/) for multi-criteria metrics.
  • Pivot tables complement single-cell statistical formulas for exploration.

Common errors

  • Arrays must be same size

Use cases

  • Linear regression
  • Trend analysis
  • Forecasting

Frequently asked questions

  • What is LINEST and when should I use it? LINEST performs linear regression analysis, returning the slope and intercept of the best-fit line through your data. Use it when you need full regression statistics (R², standard errors, F-statistic) rather than just predictions. It's essential for statistical analysis and model validation.
  • How do I interpret LINEST output with stats=TRUE? With stats=TRUE, LINEST returns a 5x2 array: Row 1: slope, intercept; Row 2: standard errors; Row 3: R², standard error of y; Row 4: F-statistic, degrees of freedom; Row 5: regression SS, residual SS. Enter as array formula or use INDEX to extract specific values.
  • What's the difference between LINEST and SLOPE/INTERCEPT? SLOPE and INTERCEPT return single values. LINEST returns both plus optional statistics. Use SLOPE/INTERCEPT for simple calculations; use LINEST when you need R², standard errors, or are doing multiple regression with several X variables.

Editorial review

  • Reviewed by Excel.Directory Editorial Team. Updated May 2026.