Excel Multiple Regression Formula: Step-by-Step Guide
In this article
Excel can run a multiple regression with a single formula: =LINEST(y_range, x_range, TRUE, TRUE). That array formula returns the slope for each predictor plus the intercept, and with the final TRUE it also returns R-squared, standard errors and the full set of diagnostics. The catch is that the output is a block of numbers that arrive in reverse order, so most of the work is reading them correctly rather than typing the formula.
Two ways exist in Excel. LINEST is the formula method and works in every desktop version. The Data Analysis ToolPak is the dialog-box method and produces a formatted report you can read at a glance. This guide covers both, starting with LINEST because that is what the question asks for.
What You'll Need
- A desktop copy of Excel (Windows or Mac). LINEST works in Excel for the web, but the array output and some shortcuts behave differently there.
- Your data laid out in columns: one column for the dependent variable (the thing you want to predict) and separate columns for each independent variable (the predictors). No blank cells, no text in the numeric columns.
- Exactly one row per observation, with the y column and every x column on the same rows. A missing value in any one column makes LINEST drop that whole row.
- For the ToolPak route only: the Analysis ToolPak add-in, enabled via File > Options > Add-ins (desktop Excel).
- More observations than predictors. Two predictors need at least three data points to fit a line, but in practice you want many more than that for anything meaningful.
Step-by-Step
Method 1: The LINEST Formula
- Lay out the columns. Put the dependent variable in one column, say column A, starting at row 2 with a header in row 1. Put predictors in columns B, C, D and so on, all on the same rows. Keep the predictors adjacent to each other so you can select them as one block.
- Count the output cells you need. LINEST returns a grid with one row for the coefficients plus four extra rows of statistics, and one column per predictor plus one column for the intercept. With two predictors (B and C) that is a 5-row by 3-column block. Select a blank area of exactly that size, for example 5 rows down and 3 columns across.
- Type the formula. With the output block still selected, type
=LINEST(A2:A100, B2:C100, TRUE, TRUE). Replace the ranges with your own. The first argument is y (must be a single column), the second is the combined block of x columns, the third TRUE means calculate the intercept normally, the fourth TRUE means return the full statistics. - Commit it as an array. In older Excel versions press Ctrl+Shift+Enter, which wraps the formula in braces. In Microsoft 365 and Excel 2021 the formula spills automatically and you only need Enter. If you select a preset block first in a modern Excel, use Ctrl+Shift+Enter to fill that exact block.
- Read the coefficients in the first row. The top-left cell is the slope of the last predictor column you selected, and the values run right-to-left. So for predictors B and C, the first cell is C's coefficient, the next is B's coefficient, and the third is the intercept. Reverse them mentally before you write the equation.
- Read the fit statistics. The third row of the block holds R-squared in the first cell and the standard error of the estimate in the second. Use R-squared to judge how much of the variation in y your predictors explain; closer to 1 means a tighter fit.
- Write the prediction equation. For coefficients in B10:D10 (C's slope, B's slope, intercept, in that order), build a working formula such as
=$D$10 + $C$10*B2 + $B$10*C2and fill it down. This gives you predicted values you can compare against the actuals. - Check the labels. LINEST does not return column headers, so add your own row above the output block naming each predictor, in the reverse order of your selection. Doing this once saves every future reader from misreading the block.
Method 2: The Data Analysis ToolPak
- Go to File > Options > Add-ins, pick Excel Add-ins in the Manage box and click Go. Tick Analysis ToolPak and confirm. Exact wording varies slightly by Excel version and region.
- On the Data tab, click Data Analysis, then choose Regression from the list.
- Set the Input Y Range to your dependent variable column including its header, and the Input X Range to the block of predictor columns including their headers. Tick Labels if you included headers, or the header row will be treated as data.
- Tick Confidence Level if you want a stated interval, leave the residuals options alone on a first run, and put the output on a new worksheet so it does not overwrite anything.
- Click OK. The report gives you coefficients with standard errors and p-values, R-squared and adjusted R-squared, and an ANOVA table — the same information as LINEST, arranged for reading.
Common Mistakes
- Reading the coefficients left to right. LINEST reverses the predictor order. This is the single most common error and it produces a confidently wrong equation.
- Including headers in the ranges. This returns #VALUE! because Excel tries to treat text as a number. Select data rows only.
- Selecting a non-contiguous x range wrongly. The second argument must be a single rectangular block. If your predictors are scattered, gather them into adjacent columns first, or the results will not line up with your columns.
- Leaving blank cells in the data. LINEST ignores entire rows containing any blank or text value, so your reported sample size can be smaller than you think. Count the rows it actually used.
- Multiplying correlated predictors. Two predictors that measure almost the same thing inflate standard errors and can flip the sign of a coefficient. Check correlations first.
- Forgetting to press Ctrl+Shift+Enter in older Excel. Enter alone returns only the top-left cell of the answer.
Tips
- Use
INDEX(LINEST(y, x, TRUE, TRUE), 1, n)to pull out a single coefficient cleanly instead of spilling the whole block. The cell reference survives recalculation. - Keep a separate worksheet for the raw data and another for analysis. It makes reruns safe when you add new rows.
- Compare the standard error of the estimate with the spread of your y values: if the error is nearly as large as the spread, the model is explaining little.
- Watch the p-values in the ToolPak report. A high p-value on a predictor suggests it adds little and can often be dropped.
- Add a scatter plot of predicted versus actual values to see whether the fit is even across the range, not just good on average.
Troubleshooting
If you get #VALUE!, check for text or empty cells inside the selected ranges, including a header row. If only one number appears where you expected a block, the formula was entered without Ctrl+Shift+Enter in an older version; reselect the block and enter it again.
If the results look reasonable but your prediction column is wildly off, you probably paired the wrong coefficient with the wrong column. Rewrite the equation with the coefficients pasted next to their predictor names.
If the ToolPak does not appear on the Data tab, the add-in did not install. Reopen File > Options > Add-ins, confirm Analysis ToolPak is ticked, and restart Excel.
If R-squared is very low, the predictors may not be relevant, the relationship may not be linear, or an important variable is missing from the model. No formula in Excel will fix a model built from the wrong inputs.
If you see a perfect or near-perfect R-squared, treat it with suspicion: it often means a predictor is accidentally a copy of the dependent variable, or that one column is calculated from another.
Frequently Asked Questions
What does LINEST actually return?
A grid of statistics. The first row holds coefficients in reverse predictor order, the second row their standard errors, the third row R-squared and the standard error of the estimate, and the last two rows hold F-statistic and degrees-of-freedom values.
How many predictors can I use?
LINEST accepts up to 64 predictors in a single block, but the practical limit is set by your data: you need many more observations than predictors for the results to mean anything.
Can I use LINEST for a single predictor?
Yes. Select a one-column x range and it behaves like SLOPE and INTERCEPT combined, with the extra statistics still available.
Which is better, LINEST or the Data Analysis ToolPak?
The ToolPak is easier to read because it labels everything and adds p-values. LINEST is better when the result needs to update automatically as data changes, since the dialog report is static.
Do I need to sort my data first?
No. Row order does not matter as long as every row keeps its y and x values together.