Regression Analysis for Financial Forecasting in Excel
By Newtown Analytics · · 8 min read
For finance, fp&a & accounting managers
Regression forecasting in Excel lets you test whether an outcome you care about, such as monthly revenue, moves with something you can influence or predict, such as marketing spend, then use that relationship to forecast. The basic version, simple linear regression, fits a straight line through the data and requires only a few built-in functions. This guide shows each step with a complete worked example whose arithmetic you can check, explains the output, describes the Excel functions and the Analysis ToolPak and lists the pitfalls that make regression forecasts misleading. It belongs to the forecasting section of budgeting and forecasting and builds on financial forecasting.
When regression helps
Regression is useful when:
- You believe a driver causes or strongly relates to the outcome (price, marketing spend, traffic, headcount, economic indicators).
- You have enough observations, at least 20 or so for a single variable, though small examples are good for learning.
- The relationship is reasonably stable over time.
- You can forecast or control the driver.
It is less helpful when the relationship is weak, the driver is itself unpredictable or the sample is tiny.
Step 1: Organize the data
Put the driver (x) in one column and the outcome (y) in another, one row per period. Here is a hypothetical dataset of eight months: marketing spend (x, in thousands of dollars) and revenue (y, in thousands).
| Month | Marketing spend (x) | Revenue (y) |
|---|---|---|
| 1 | 10 | 112 |
| 2 | 12 | 119 |
| 3 | 15 | 138 |
| 4 | 11 | 117 |
| 5 | 18 | 150 |
| 6 | 20 | 163 |
| 7 | 14 | 131 |
| 8 | 16 | 140 |
Step 2: Plot it
Insert a scatter chart, with x on the horizontal axis. Check that the points roughly follow a line, and look for outliers. If the pattern is curved, a straight line will mislead.
Step 3: Calculate the line
The line is y = intercept + slope × x. Excel functions:
=SLOPE(y_range, x_range)
=INTERCEPT(y_range, x_range)
=RSQ(y_range, x_range)
=FORECAST.LINEAR(x_value, y_range, x_range) (older versions: FORECAST)
=STEYX(y_range, x_range)
To see how the numbers arise, here is the calculation by hand.
- Mean of x = 116 / 8 = 14.5; mean of y = 1,070 / 8 = 133.75.
- Sum of squared deviations of x (Sxx) = 84.0.
- Sum of cross products of deviations (Sxy) = 424.0.
- Slope = Sxy / Sxx = 424 / 84 = 5.048.
- Intercept = 133.75 - 5.048 × 14.5 = 60.56.
The fitted line is: revenue = 60.56 + 5.048 × marketing spend.
Step 4: Interpret the results
- Slope (5.048): in this sample, each extra $1,000 of marketing spend is associated with about $5,048 of additional revenue. This is an association; it may not be causal and it will not hold forever, because returns diminish.
- Intercept (60.56): the revenue expected with zero marketing spend, which is outside the range of the data and should not be taken literally.
- R-squared: the share of variation in revenue explained by marketing spend. Here the sum of squared deviations of y (Syy) is 2,155.5, so R-squared = 424² / (84 × 2,155.5) = 179,776 / 181,062 = 0.993. That is unusually high; the data are illustrative. Real business data are noisier, and a high R-squared can occur by chance with trending series.
- Standard error (STEYX): the typical distance of actual values from the line. Residual sum of squares = 2,155.5 - 424² / 84 = 2,155.5 - 2,140.2 = 15.3. Standard error = square root of (15.3 / 6) = 1.6, in thousands of dollars.
Step 5: Forecast
If the plan is to spend $17,000 next month:
=FORECAST.LINEAR(17, y_range, x_range)
Forecast revenue = 60.56 + 5.048 × 17 = 60.56 + 85.82 = 146.4 (thousand dollars), with a rough range of plus or minus two standard errors (about 3.2), so 143.2 to 149.6. In real data, ranges are wider. Treat the range as a guide: a proper prediction interval is somewhat wider than two standard errors because it includes uncertainty in the line itself.
Step 6: Check the fit
| Check | What to look for |
|---|---|
| Scatter plot | Straight-line pattern, no obvious curve |
| Residuals (actual minus fitted) | Randomly scattered around zero, no pattern over time |
| R-squared | High enough to be useful, but not the only test |
| Outliers | One point driving the whole result |
| Out-of-sample test | Fit on the first six months, predict months 7 and 8, compare |
An out-of-sample test is the most honest. Fit the line on months 1 to 6 and see how well it predicts months 7 and 8.
A worked out-of-sample test
Fit the line on only the first six months and see how it predicts months 7 and 8, which the model has not seen.
- Months 1 to 6: spend 10, 12, 15, 11, 18, 20; revenue 112, 119, 138, 117, 150, 163.
- Mean spend 14.33, mean revenue 133.17, Sxx = 81.33, Sxy = 412.67.
- Slope = 412.67 / 81.33 = 5.074; intercept = 133.17 - 5.074 × 14.33 = 60.44.
| Month | Spend | Predicted revenue | Actual | Error (predicted - actual) |
|---|---|---|---|---|
| 7 | 14 | 60.44 + 5.074 × 14 = 131.5 | 131 | +0.5 |
| 8 | 16 | 60.44 + 5.074 × 16 = 141.6 | 140 | +1.6 |
Mean absolute error = (0.5 + 1.6) / 2 = 1.05. A naive benchmark that always predicts the average revenue of the first six months (133.17) would be off by 2.17 and 6.83, a mean absolute error of 4.5. The regression is better than the benchmark in this test, which is the evidence you want before relying on a model. With real data, expect larger errors and fewer clean results, and run the test over more periods.
Preparing the workbook
Good layout prevents mistakes.
| Tab | Content |
|---|---|
| Data | Raw history with dates, driver and outcome, and notes on adjustments |
| Model | SLOPE, INTERCEPT, RSQ and STEYX formulas, referencing the Data tab |
| Forecast | Planned driver values, forecast outcomes and ranges |
| Checks | Out-of-sample test, residual chart, comparison with naive benchmark |
| Notes | Assumptions, data sources and date of last refresh |
Use named ranges for the x and y data so formulas read clearly, and extend them as new periods are added. Keep a log of when the model was last re-estimated.
Multiple regression
To use more than one driver (for example marketing spend and number of sales reps), use the LINEST function or the Analysis ToolPak.
=LINEST(y_range, x_range_with_multiple_columns, TRUE, TRUE)
LINEST returns an array of coefficients and statistics. In Excel versions without dynamic arrays, select a range of the right size and press Ctrl+Shift+Enter. The ToolPak (Data tab, Data Analysis, Regression) produces a clear summary table with coefficients, standard errors, t-statistics and p-values. Enable it from Excel's add-ins if you cannot see it.
Add drivers one at a time and keep only those that improve the out-of-sample forecast, not only R-squared.
Pitfalls
| Pitfall | Why it matters | What to do |
|---|---|---|
| Correlation is not causation | Revenue and spend might both rise with seasonality | Include the seasonal factor or use year-over-year changes |
| Extrapolating beyond the data | The relationship may break outside the range | Stay within observed ranges |
| Trending data | Two trending series can look related by chance | Use changes or ratios, or test relationships on detrended data |
| Autocorrelation | Errors that follow each other make standard errors too optimistic | Check residual patterns |
| Multicollinearity | Correlated drivers make coefficients unstable | Remove or combine drivers |
| Structural changes | A price change or acquisition shifts the relationship | Fit separately or include a flag variable |
| Small samples | Results can be chance | Use more data and validate out of sample |
| Overfitting | Too many variables fit noise | Prefer simple models, test on new data |
Lag effects
Marketing spend often affects revenue with a delay. Test lags by shifting the x column: compare spend in the prior month, or two months earlier, against revenue. Choose the lag that makes business sense and improves out-of-sample accuracy.
Using regression in planning
- Cost estimation: relate overhead to activity to estimate fixed and variable parts. See flexible budgets.
- Revenue drivers: link revenue to traffic, pipeline or capacity.
- Working capital: relate receivables to sales to estimate days outstanding.
- Scenario testing: change the driver and see the forecast response. See sensitivity analysis in financial models.
Regression and unit economics
Regression can help estimate variable cost per unit and the fixed cost base, which are inputs to unit economics. Always confirm with operations data. See unit economics.
Common mistakes
- Relying on R-squared alone.
- Using too little data.
- Forecasting with a driver you cannot predict.
- Ignoring seasonality.
- Not validating out of sample.
- Assuming the relationship is permanent.
Related guides
For a more operational approach, see driver-based forecasting. To test how sensitive the forecast is to each input, read scenario planning for finance teams.
FAQs
How do I do a regression forecast in Excel?
Put the driver and outcome in columns, plot them, use SLOPE and INTERCEPT (or FORECAST.LINEAR) to fit a line, check the fit and forecast with the driver's planned value.
What is a good R-squared for forecasting?
It depends on the data. A high value is not enough on its own; check residuals and test on new data.
What does the slope mean?
The average change in the outcome for a one-unit change in the driver, within the observed range.
How many data points do I need?
More is better. A common guide is at least 20 observations for one driver, and more for multiple drivers.
Can regression handle seasonality?
Yes, by adding seasonal dummy variables or using seasonally adjusted data.
Keep reading
- Complete guide: Budgeting and Forecasting: The Complete Guide for Finance Leaders
- Driver-Based Forecasting: A Practical Guide
- Scenario Planning for Finance Teams: A Practical Framework
- Financial Forecasting: Methods, Models, and Best Practices
- Related topic: Unit Economics: The Complete Guide to Profitable Growth
This article is for general information. It is not accounting, tax, legal or investment advice, and examples use illustrative numbers rather than client data. Confirm decisions that carry financial or legal consequences with a qualified professional.