LINEST Function in Excel: Full Regression Statistics

LINEST Function in Excel: Full Regression Statistics featured illustration

📎 This article includes 1 downloadable practice file ↓

⏱ 2 min readUpdated 5 October 2026

StatisticsLevel: ExpertAvailable in: Excel 2007+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Example 2
  5. LINEST in practice
  6. Where you will use it
  7. Worked example
  8. Mistakes people make
  9. Related functions
  10. Continue learning

LINEST fits a straight line (or a multiple regression) and returns slope, intercept and, optionally, R², standard errors and more — an entire regression output from one formula.

Advertisement

Syntax

=LINEST(known_ys, [known_xs], [const], [stats])
Argument What it means
known_xs One or more columns of predictors.
stats TRUE for the full statistics block.

Examples

Example 1

=LINEST(D2:D40, B2:C40, TRUE, TRUE)

Sales explained by ad spend and price: spills a 5-row stats table.

Example 2

=INDEX(LINEST(D2:D40, B2:B40), 1)

Just the slope.

💡 Coefficients come back in reverse column order — the last x column first. Everyone gets caught by this once.

LINEST in practice

Where you will use it

  • Slope and intercept in one go
  • Multiple regression
  • Trend statistics

Worked example

OutputFormulaResult
Slope=ROUND(INDEX(LINEST({100,108,115,124,130,139},{1,2,3,4,5,6},TRUE,TRUE),IF(ROW()=4,3,1),IF(ROW()=3,2,1)),4)7.7143
Intercept=ROUND(INDEX(LINEST({100,108,115,124,130,139},{1,2,3,4,5,6},TRUE,TRUE),IF(ROW()=4,3,1),IF(ROW()=3,2,1)),4)92.3333
R²=ROUND(INDEX(LINEST({100,108,115,124,130,139},{1,2,3,4,5,6},TRUE,TRUE),IF(ROW()=4,3,1),IF(ROW()=3,2,1)),4)0.9982

Results calculated in Excel.

Mistakes people make

MistakeWhat to do instead
Array outputLINEST returns a table; use INDEX to pick values
Order of resultsCoefficients come in reverse order of x columns

SLOPE · TREND · LOGEST

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

⚡ Interactive Practice Lab & Formula Tester:

Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.

📎 Practice files for this article

  • 📗
    Practice workbook: Statistics advanced33 tasks on realistic sales data — type your formula, the Check column turns green when it is right. Answers sheet included.
    ⬇ XLSX · 36 KB

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong