Statistical function

FORECAST function

Predicts a value along a straight-line trend through known data. The original name of FORECAST.LINEAR, available in every Excel version.

Available in All versions of Excel, Excel for the web, Excel for Mac

In every Excel versionWorks in Google Sheets

Syntax

FORECAST(x, known_y's, known_x's)
ArgumentWhat it means
xRequiredThe point to predict for.
known_y'sRequiredThe known results (dependent values).
known_x'sRequiredThe known inputs (independent values), same count as known_y's.

Returns: The value on the least-squares line at x.

How FORECAST works

FORECAST fits the best straight line through pairs of known values and returns the line's value at a new point. It is mathematically identical to FORECAST.LINEAR: Microsoft added the .LINEAR name in Excel 2016 to sit alongside the new FORECAST.ETS family, but kept FORECAST so that existing workbooks still calculate.

Use FORECAST when a workbook must also open in Excel 2013 or older; otherwise either name is fine. Everything about how the line is fitted, the argument order (y values before x values) and the cautions about extrapolating far beyond your data applies equally to both.

Examples

1Next month's sales

D2fx=FORECAST(7, B2:B7, A2:A7)
ABCD
1Month no.Sales (units)
21120187.87
32132
43141
54155
65163
76178

Result: 187.87

The straight-line trend through months 1–6 reaches 187.87 units in month 7, exactly the same as =FORECAST.LINEAR(7, B2:B7, A2:A7).

2Delivery cost for a heavier parcel

D2fx=FORECAST(6, B2:B6, A2:A6)
ABCD
1Weight (kg)Cost (€)
216.211.28
327.1
449.3
5510.1
6813.4

Result: 11.28

The courier's past prices rise by about €1.03 per kg. The line predicts a cost of about €11.28 for a 6 kg parcel (2 decimals).

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe two known ranges contain different numbers of values.Use ranges of the same size.
#DIV/0!The x values do not vary (or are empty).Supply varying x values.

Tips

  • For new workbooks in Excel 2016 or later, FORECAST.LINEAR makes the intention clearer to other readers.

Google Sheets

FORECAST also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

FORECAST in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishPROGNOSE
DutchVOORSPELLEN
FinnishENNUSTE
FrenchPREVISION
GermanSCHÄTZER
HungarianELŐREJELZÉS
ItalianPREVISIONE
Norwegian (Bokmål)PROGNOSE
PolishREGLINX
Portuguese (Brazil)PREVISÃO
Portuguese (Portugal)PREVISÃO
RussianПРЕДСКАЗ
SpanishPRONOSTICO
SwedishPREDIKTION
TurkishTAHMİN