Example 1
Predict the next month from a steady trend
D2 =ROUND(FORECAST(7,B2:B7,A2:A7),2)
Result: 160
Units rise by exactly 10 a month, so the line predicts 160 for month 7.
D2 =ROUND(FORECAST(7,B2:B7,A2:A7),2) returns 160
Predicts a value for a new x by fitting a straight line through known x and y values. The older name of FORECAST.LINEAR.
Syntax
=FORECAST(, , )
All versions of Excel. Excel 2016 and later also include FORECAST.LINEAR, which does the same thing.
Try it
Edit the formula in D2 or change the inputs. The sheet recalculates as you type.
D2 =ROUND(FORECAST(7,B2:B7,A2:A7),2) returns 160
FORECAST fits the best straight line through your known data, using least squares, and reads off the y value for a new x. With sales of 12, 15, 19, 20, 26 and 27 over months 1 to 6, =FORECAST(7,B2:B7,A2:A7) returns about 30.73 for month 7.
FORECAST is the original name, kept for compatibility. FORECAST.LINEAR takes the same arguments and returns the same result. Use FORECAST.LINEAR in new work if every user has Excel 2016 or later, and FORECAST if the file must open in older versions.
The two ranges must be the same size, otherwise the result is #N/A. If known_xs has no variation, FORECAST returns #DIV/0!.
FORECAST is the same as =INTERCEPT(known_ys,known_xs)+SLOPE(known_ys,known_xs)*x. SLOPE is how much y changes per unit of x, and INTERCEPT is where the line crosses y when x is zero. Writing it out is useful when you need to show the slope in a report as well as the prediction.
To predict several periods, put the new x values in a column and use absolute references for the known data: =FORECAST(D2,$B$2:$B$7,$A$2:$A$7). Without the dollar signs the ranges move as you fill and the result changes.
You can use dates for x. FORECAST treats them as serial numbers, so the line runs through time at a constant rate per day. It does not know about seasonality.
FORECAST draws a straight line and extends it. It is a reasonable guide when the trend is steady, but it does not capture seasonality or turning points, and the further you extrapolate beyond your data, the less reliable it gets. Check the fit with RSQ before relying on it. For seasonal data, look at FORECAST.ETS in Excel 2016 and later.
Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
D2 =ROUND(FORECAST(7,B2:B7,A2:A7),2)
Result: 160
Units rise by exactly 10 a month, so the line predicts 160 for month 7.
D2 =ROUND(FORECAST(7,B2:B7,A2:A7),2) returns 160
Example 2
D2 =ROUND(FORECAST(7,B2:B7,A2:A7),2)
Result: 30.73
The points don't sit exactly on a line. FORECAST predicts from the best-fit line through them.
D2 =ROUND(FORECAST(7,B2:B7,A2:A7),2) returns 30.73
Example 3
D2 =ROUND(FORECAST(60,B2:B6,A2:A6),2)
Result: 28.3
The x value does not have to be the next row. It is predicted from the line the data defines.
D2 =ROUND(FORECAST(60,B2:B6,A2:A6),2) returns 28.3
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In E2, forecast the units for the month in D2 from the six known months. Fill it down to E4.
Answer in E2, then it fills down to E4.
FORECAST(x, known_ys, known_xs). Swapping them gives a wrong answer without an error.$, for example $B$2:$B$7.#N/A.Nothing in the result. FORECAST.LINEAR is the newer name, available from Excel 2016. FORECAST works in all versions.
Use `=FORECAST(next_month_number, sales_range, month_number_range)`. Number the months 1, 2, 3 and so on, or use dates.
FORECAST draws one straight line, so it misses seasonality. Use FORECAST.ETS, or adjust for the season before you fit a line.
It equals `INTERCEPT + SLOPE * x`, using a least-squares line through the known values.
Tracks take you from the basics to modelling, one graded exercise at a time.