LINEST Function in Excel: Full Regression Statistics

⏱ 1 min readUpdated 28 September 2026

StatisticsLevel: ExpertAvailable in: Excel 2007+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Example 2
  5. Related functions

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.

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.

SLOPE · TREND · LOGEST

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

✨ Ask AI about this article

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

Free · AI can be wrong