Skip to content

FORECAST

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(, , )

Statistical

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
A
B
C
D
1
Month
Units
Month 7
2
1
100
160
3
2
110
4
3
120
5
4
130
6
5
140
7
6
150
8

D2 =ROUND(FORECAST(7,B2:B7,A2:A7),2) returns 160

How FORECAST works

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 and FORECAST.LINEAR

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 three arguments

  • x is the point to predict for. It can be a number, a date or a cell reference. It is not a range, so to predict several points fill the formula down.
  • known_ys are the observed outcomes.
  • known_xs are the matching inputs, in the same order. Note the order: the y values come before the x values, which is the reverse of what many people expect.

The two ranges must be the same size, otherwise the result is #N/A. If known_xs has no variation, FORECAST returns #DIV/0!.

How it works

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.

Filling down

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.

Dates as x

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.

Know the limits

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.

Arguments

x
The point to predict for, for example month 7. It is a single number or a cell holding one.
known_ys
The known dependent values, such as past sales.
known_xs
The known independent values, such as month numbers. It must hold the same number of values as known_ys.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

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
A
B
C
D
1
Month
Units
Month 7
2
1
100
160
3
2
110
4
3
120
5
4
130
6
5
140
7
6
150
8

D2 =ROUND(FORECAST(7,B2:B7,A2:A7),2) returns 160

Example 2

Predict from noisy data

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
A
B
C
D
1
Month
Sign-ups
Month 7
2
1
12
30.73
3
2
15
4
3
19
5
4
20
6
5
26
7
6
27
8

D2 =ROUND(FORECAST(7,B2:B7,A2:A7),2) returns 30.73

Example 3

Predict at a value of x that is not the next step

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
A
B
C
D
1
Ad spend
Leads
Leads at 60
2
10
12
28.3
3
20
15
4
30
19
5
40
20
6
50
26
7

D2 =ROUND(FORECAST(60,B2:B6,A2:A6),2) returns 28.3

Your turn.

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.

E2
A
B
C
D
E
F
G
1
Month
Units
Month
Forecast
Month 12
2
1
12
7
3
2
15
8
4
3
19
9
5
4
20
6
5
26
7
6
27
8

Common mistakes

  • The y values come first, then the x values: FORECAST(x, known_ys, known_xs). Swapping them gives a wrong answer without an error.
  • It assumes a straight line. Seasonal or curved data will give a misleading forecast.
  • When you fill down, lock the known ranges with $, for example $B$2:$B$7.
  • The ranges must be the same size. Otherwise the result is #N/A.

Questions people ask

What is the difference between FORECAST and FORECAST.LINEAR?

Nothing in the result. FORECAST.LINEAR is the newer name, available from Excel 2016. FORECAST works in all versions.

How do I forecast the next month in Excel?

Use `=FORECAST(next_month_number, sales_range, month_number_range)`. Number the months 1, 2, 3 and so on, or use dates.

Can I forecast with seasonal data?

FORECAST draws one straight line, so it misses seasonality. Use FORECAST.ETS, or adjust for the season before you fit a line.

How is FORECAST calculated?

It equals `INTERCEPT + SLOPE * x`, using a least-squares line through the known values.

Learn FORECAST in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.