In Excel: use =LINEST(known_ys, known_xs, TRUE, TRUE) — it returns the regression coefficients as an array, plus R², standard errors and the other statistics when stats is TRUE.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
known_ys | required | The outcomes being modelled. |
known_xs | optional | One or more columns of predictors. |
const | optional | FALSE forces the intercept to zero. |
stats | optional | TRUE returns the full diagnostic block including R² and standard errors. |
Related functions
Select a cell with several empty rows and columns beneath and to the right.
Type =LINEST( and select the y column, then the block of x columns.
Add , TRUE, TRUE to fit an intercept and return the diagnostics.
Press Enter in Excel 365, or select a 5-row block and press Ctrl+Shift+Enter in older versions.
What this does
LINEST is Excel's full least-squares regression in a single function. With the fourth argument set to TRUE it returns a block of diagnostics rather than just coefficients: R², standard errors for each coefficient, the F statistic and the degrees of freedom. Two things surprise everyone the first time. The coefficients come back in reverse order, with the last predictor leftmost and the intercept at the far right. And it accepts several predictor columns, which makes it a genuine multiple regression without the Analysis ToolPak. In Excel 365 the block spills; older versions need a selected range and Ctrl+Shift+Enter. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. Treat “linest function excel” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected formula shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a calculation you can defend to a CFO or an auditor into a method you can reuse, explain, and defend when the workbook leaves your screen.
A worked example
Sales in D2:D100 modelled on spend in B2:B100 and headcount in C2:C100: =LINEST(D2:D100, B2:C100, TRUE, TRUE) spills a five-row block. The top row holds the coefficients right-to-left (headcount, spend, intercept) and the third row's first cell is R². For a single predictor, SLOPE and INTERCEPT are far easier to read. LINEST is a complete regression without a add-in, which matters whenever the model has to live in the workbook rather than in a separate tool. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.
In Google Sheets
Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. For “linest function excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.
Common mistakes
- Reading the coefficients left to right — they are returned in reverse predictor order, with the intercept last.
- Omitting the final TRUE and then looking for R², which is only returned when stats is switched on.
- Adding predictors without checking they are not collinear, which makes individual coefficients unstable and misleading.
Frequently asked questions
How do I read the LINEST output?
Row 1 holds the coefficients in reverse order of the x columns, with the intercept rightmost. Row 2 holds their standard errors, and row 3 column 1 is R².
Can LINEST do multiple regression?
Yes — pass several adjacent columns as known_xs and it fits them all.
Where is R² in the output?
The first cell of the third row, and only when the fourth argument is TRUE.
Other ways people ask this
This is also commonly searched as “function linest excel”, “how to use linest function excel” and “linest function excel output”. They describe the identical operation, so you are in the right place no matter how you phrased it.
Why do people search for this in so many different ways?
Because the same task has many names. “function linest excel”, “how to use linest function excel”, “linest function excel output” all point at the one operation explained on this page, which is why they all lead here.