Excel like a finance pro.
Statistical function
LINEST
Returns the parameters of a linear regression as an array, with statistics on request.
When to use it
Full least-squares regression in one function: slope and intercept, and with stats TRUE the standard errors, R², F statistic, and residual sums. Handles several x columns for multiple regression.
The shape of it
- Syntax
=LINEST(known_ys, [known_xs], [const], [stats])
Worked examples
Slope and intercept
=LINEST({2,4,6,9},{1,2,3,4}) → {2.3,-0.5}
Slope then intercept, spilled across two cells.
Pull R²
=INDEX(LINEST({2,4,6,9},{1,2,3,4},TRUE,TRUE),3,1) → 0.988785047
Row 3, column 1 of the stats block is R².
Multiple regression
=LINEST(D2:D50,A2:C50) → {b3,b2,b1,b0}
Multiple regression on three x columns. Coefficients come back in reverse column order.
Worth knowing
- The stats block is 5 rows: coefficients, standard errors, R² and standard error of y, F and degrees of freedom, regression and residual sums of squares.
- Coefficients are returned right to left: the last x column first, the intercept last.
- Wrap in INDEX to pull one number without spilling the whole block.
Where it goes wrong
- #REF! when x and y have different lengths.
- #VALUE! when a cell is text or blank.
- Collinear x columns give near-zero coefficients with huge standard errors.
Related
Learn the moves here — or let Wauvel run them on your numbers.
Meet your AI CFO →One CFO-grade Excel tip a week
A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.