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)| Argument | What it means | |
|---|---|---|
x | Required | The point to predict for. |
known_y's | Required | The known results (dependent values). |
known_x's | Required | The 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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month no. | Sales (units) | ||
| 2 | 1 | 120 | 187.87 | |
| 3 | 2 | 132 | ||
| 4 | 3 | 141 | ||
| 5 | 4 | 155 | ||
| 6 | 5 | 163 | ||
| 7 | 6 | 178 |
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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Weight (kg) | Cost (€) | ||
| 2 | 1 | 6.2 | 11.28 | |
| 3 | 2 | 7.1 | ||
| 4 | 4 | 9.3 | ||
| 5 | 5 | 10.1 | ||
| 6 | 8 | 13.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).
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | The 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.
| Language | Function name |
|---|---|
| Danish | PROGNOSE |
| Dutch | VOORSPELLEN |
| Finnish | ENNUSTE |
| French | PREVISION |
| German | SCHÄTZER |
| Hungarian | ELŐREJELZÉS |
| Italian | PREVISIONE |
| Norwegian (Bokmål) | PROGNOSE |
| Polish | REGLINX |
| Portuguese (Brazil) | PREVISÃO |
| Portuguese (Portugal) | PREVISÃO |
| Russian | ПРЕДСКАЗ |
| Spanish | PRONOSTICO |
| Swedish | PREDIKTION |
| Turkish | TAHMİN |