Multiple Linear Regression in Excel: Step-by-Step
In this article
You can run a multiple linear regression in Excel in a few minutes using the Analysis ToolPak add-in: enable Data Analysis under File > Options > Add-ins, then go to Data > Data Analysis > Regression, select your Y range and all your X columns in one contiguous block, tick Labels if the first row holds headings, choose an output cell, and click OK. Excel returns coefficients, R-squared, standard errors, p-values and confidence intervals in a single table. Everything below assumes Excel for Windows; Excel for Mac has the same ToolPak under Tools > Excel Add-ins, and the labels in either version can differ slightly by release and region. If you only need a quick trend line through one variable, a normal chart is enough; multiple regression is what you want when two or more inputs jointly explain an outcome and you need to know which ones actually matter.
What You'll Need
- Excel for Windows or Mac (the desktop app, not Excel for the web, which does not run the Analysis ToolPak).
- The Analysis ToolPak add-in enabled. It ships with Excel but is switched off by default.
- Your data in one clean table: one row per observation, one column per variable, no blank rows or columns inside the block, and no merged cells.
- Numeric values only in the regression columns. Text like "n/a", "-" or a trailing space in a number will drop that row silently.
- At least one more observation (row) than the number of predictors plus one. More is better: a rule of thumb is a few dozen rows per predictor before the results are worth trusting.
Step-by-Step
- Enable the Analysis ToolPak. Go to File > Options > Add-ins. At the bottom, set the Manage dropdown to Excel Add-ins and click Go. Tick Analysis ToolPak and click OK. On Mac, use Tools > Excel Add-ins instead. If the Data Analysis button does not appear on the Data tab afterwards, restart Excel.
- Arrange your data as one block. Put the dependent variable (the thing you are predicting) in one column and every independent variable in the columns immediately to its right. Columns in the middle of the block, or a predictor separated by an empty column, will be ignored or will cause an error. Give each column a heading in row 1, written in a single cell, no line breaks.
- Clean the rows first. Check for blanks inside the range. Excel's Regression tool deletes any row with a missing cell in the selected block, which silently shrinks your sample and can bias the result. Either filter the table so incomplete rows are gone or fill them deliberately. Also convert any numbers stored as text: select the column, use Data > Text to Columns and click Finish, which forces conversion.
- Open the tool. Go to Data > Data Analysis, pick Regression from the list, and click OK.
- Set the Input Y Range. Click in the field and drag over your dependent variable column, headings included. Then set Input X Range to all predictor columns at once, again headings included. Make sure the two ranges are the same number of rows.
- Tick Labels if the first row of each range contains headings. Leave it unticked if it does not, otherwise Excel treats the heading text as a data point and the regression fails.
- Decide on constant and residuals. Leave Constant is Zero unticked unless theory genuinely says the line must pass through the origin. Ticking Residuals, Residual Plots and Line Fit Plots is optional but useful for checking assumptions later.
- Choose an output location. Select Output Range and click an empty cell on a different sheet, leaving plenty of room below and to the right. Never point the output at a cell that already contains data; Excel overwrites it without warning.
- Click OK and read the summary. Start with Multiple R and R Square for overall fit. Then look at the Coefficients table: each predictor's coefficient is its estimated effect on Y holding the others constant, the p-value tells you whether that effect could plausibly be zero, and the confidence interval gives the range. Significance F tells you whether the model as a whole beats a plain average.
- Write out the equation. It takes the form Y = Intercept + coefficient 1 × X1 + coefficient 2 × X2, and so on. Round the coefficients sensibly for how you will use them, and keep the units straight: a coefficient is "change in Y per one-unit change in X".
- Sanity-check before you trust it. Plug in a few rows of your own data and compare the predicted value with the actual. Large systematic gaps mean a missing variable, a misread column or a data-entry error.
Common Mistakes
Non-contiguous X ranges. This is the most frequent failure. Excel needs the predictor columns side by side in one selection. Move columns so they touch before running the tool.
Wrong Labels setting. Headings counted as data give a completely wrong result or an error. If your output has a predictor named after a text heading with nonsensical numbers, this is why.
Forgotten text-converted numbers. A column of numbers with a stray space or an apostrophe is treated as text and either drops the rows or excludes the column. Use the Text to Columns trick or check that the cells are right-aligned by default.
Reading a high R-squared as proof. R-squared rises whenever you add a predictor, even a useless one. Compare the adjusted R-squared, and check the p-values of each coefficient rather than the overall fit alone.
Ignoring collinearity. If two predictors carry almost the same information (for example total sales and number of orders), both coefficients can become unstable and one may show a large p-value despite the variable clearly mattering. Try the model with one of the pair removed and see whether the other stays stable.
Extrapolating outside the data. A coefficient fitted on prices from a certain band says little about prices far outside it.
Tips
Put the dependent variable in the leftmost column of your block by habit; it makes range selection harder to get wrong.
Keep a separate scratch sheet for every model run so you can compare specifications without overwriting earlier output.
Add the residual output and plot residuals against predicted values. A curved pattern hints the relationship is not linear; a funnel shape hints the variance is not constant.
Standardise or at least note the scale of each predictor. A coefficient of 0.02 on a variable measured in thousands is not "smaller" than one of 0.5 on a variable measured in units.
Watch the sample-size-to-predictor ratio. Inflated standard errors and unstable signs are the usual symptom of too many predictors for too few rows.
If Excel's results look suspicious, re-run the same data with a stats package or a trusted regression calculator as a cross-check. Agreeing numbers are a good sign the ranges were selected correctly.
Troubleshooting
The Data Analysis button is missing. The add-in is not enabled or Excel needs a restart. Re-check File > Options > Add-ins with Manage set to Excel Add-ins, then close and reopen Excel entirely.
"Input range contains non-numeric data." A cell in the selected block holds text, a blank, or a number stored as text. Select each column in turn, run Text to Columns, and inspect for stray spaces or dash placeholders.
"Input X Range contains non-numeric data" but the column looks fine. Check for a single empty cell or a formula returning an empty string further down the column, and check that your X range does not accidentally include the Y column twice.
No p-values or a row of #NUM! errors. Usually too few observations for the number of predictors, or a predictor column that is constant. Remove the constant column or collect more rows.
R-squared is 1.0 or a coefficient is absurdly large. A predictor is probably a duplicate of another column, or of the dependent variable itself. Scan for copied ranges.
Results change every time you re-run. The output range is overlapping an existing table, so Excel is writing into cells that feed the calculation. Point the output at a fresh sheet.
Mac users see different menus. The ToolPak sits under Tools > Excel Add-ins and the Data Analysis command may appear on the Data tab or in the Tools menu depending on the version. If it is absent in Excel for the web, use the desktop app.
Frequently Asked Questions
Do I need the Analysis ToolPak for regression?
For a proper multiple regression with standard errors and p-values, yes. You can fit an equation manually with LINEST, but the ToolPak output is easier to read and less error-prone.
Why are some of my rows missing from the output?
Excel deletes any row with an empty cell in the selected Y or X ranges. Clean the data before running the tool so the observation count in the output matches your table.
How many predictors can I use?
There is no fixed cap, but each predictor costs a degree of freedom. Keep the number small relative to your row count or the coefficients and p-values become unreliable.
Can I use dates or categories as predictors?
Dates can be used directly if Excel stores them as serial numbers. Text categories cannot; convert each category into a numeric indicator column (1 or 0) first.
What R-squared value is good?
It depends entirely on the subject. Compare your model against a simpler one on the same data rather than against a universal threshold.
Does it work in Excel for the web?
No. The Analysis ToolPak is only in the desktop app for Windows and Mac, so open the workbook there and the results will be saved in the file.