FORECAST.LINEAR function
Predicts a future value by fitting a straight line through known data, e.g. next month's sales from the past six months.
Available in Microsoft 365, Excel 2016 and later, Excel for the web
Excel 2016 and laterWorks in Google Sheets
Syntax
FORECAST.LINEAR(x, known_y's, known_x's)| Argument | What it means | |
|---|---|---|
x | Required | The point you want a prediction for, such as month 7 or a future date. |
known_y's | Required | The known results you want to predict, e.g. past sales. |
known_x's | Required | The known inputs that go with them, e.g. month numbers, dates or ad spend. Same number of values as known_y's. |
Returns: A number: the value on the best-fit straight line at x.
How FORECAST.LINEAR works
FORECAST.LINEAR draws the best straight line through your past data and reads off where that line will be at a new point. Give it the history (the y values you care about and the x values that go with them) and the x you are interested in, and it returns the predicted y. It is the quickest way to extend a steady trend: next month's sales, staff needed for a given order volume, expected cost at a certain production level.
The line is the ordinary least-squares line, the same one Excel draws as a linear trendline on a chart. Its slope is SLOPE and its starting point is INTERCEPT; FORECAST.LINEAR simply calculates intercept + slope × x. Dates work as x values because Excel stores them as serial numbers.
A straight line ignores seasonality and curves. If your sales jump every December, use FORECAST.ETS, which learns repeating patterns. And remember that any forecast is an extrapolation: the further x is from your data, the less you should trust it. FORECAST.LINEAR gives the same result as the older FORECAST.
Examples
1Next month's sales from the trend
| 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 best-fit line rises by about 11.34 units a month (=SLOPE(B2:B7, A2:A7)). Continuing it to month 7 gives 187.87 units (shown with 2 decimals), a sensible order quantity for July.
2Sales expected for a given ad budget
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Month | Ad spend (k€) | Sales (k€) | ||
| 2 | Jan | 2 | 41 | 62.12 | |
| 3 | Feb | 3.5 | 58 | ||
| 4 | Mar | 1.5 | 44 | ||
| 5 | Apr | 4 | 56 | ||
| 6 | May | 3 | 53 | ||
| 7 | Jun | 5 | 66 |
Result: 62.12
Here x is not time but advertising spend. The line through the six months predicts sales of 62.12 k€ for a 4.5 k€ budget. Note the argument order: the values to predict (sales) come before the inputs (spend).
3Forecasting on a date axis
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month start | Subscribers | ||
| 2 | 2026-01-01 | 2480 | 2,912 | |
| 3 | 2026-02-01 | 2555 | ||
| 4 | 2026-03-01 | 2610 | ||
| 5 | 2026-04-01 | 2700 | ||
| 6 | 2026-05-01 | 2765 | ||
| 7 | 2026-06-01 | 2840 |
Result: 2,912
The dates in column A are serial numbers (1 Jan 2026 is 46023), so the line is fitted per day. Predicting for 1 July 2026 gives about 2,912 subscribers (no decimals). Because months have different lengths, a per-day line is slightly more accurate than numbering the months 1 to 6.
4Staff needed for 300 orders a day
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Orders per day | Staff on shift | ||
| 2 | 120 | 6 | 14.8 | |
| 3 | 150 | 7 | ||
| 4 | 180 | 9 | ||
| 5 | 210 | 10 | ||
| 6 | 240 | 12 |
Result: 14.8
Past shifts suggest about 5.0 extra staff per 100 orders. At 300 orders the line gives 14.8 people, so plan for 15. 300 is beyond the observed range (120–240), so treat this as a rough guide.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | known_y's and known_x's have different numbers of values. | Make both ranges the same size. |
#DIV/0! | All the known_x's are the same, so no line can be fitted (or the ranges are empty). | Provide x values that vary. |
#VALUE! | x is text. | Use a number or a real date. |
Tips
- Check how well the line fits with
=RSQ(B2:B7, A2:A7); close to 1 means the trend explains the data well. - To forecast several future points at once in Microsoft 365, pass an array as x:
=FORECAST.LINEAR(SEQUENCE(3,1,7), B2:B7, A2:A7)spills months 7–9. - For a curved (exponential) trend use GROWTH; for several input variables use TREND or LINEST.
Questions
What is the difference between FORECAST and FORECAST.LINEAR?
They calculate exactly the same thing. FORECAST.LINEAR is the newer name introduced in Excel 2016 next to the ETS functions; FORECAST is kept so older workbooks keep working and is available in every version.
Should I use FORECAST.LINEAR or FORECAST.ETS?
Use FORECAST.LINEAR for a steady trend or when x is not time (ad spend, orders). Use FORECAST.ETS for time series with seasonal patterns, such as monthly retail sales.
Why is my forecast negative?
The straight line keeps going. If your data trend downwards, extending far enough will cross zero. Forecast only a short distance beyond your data, or use a model that cannot go negative.
Google Sheets
FORECAST.LINEAR also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
FORECAST.LINEAR 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.LINEÆR |
| Dutch | VOORSPELLEN.LINEAR |
| Finnish | ENNUSTE.LINEAARINEN |
| French | PREVISION.LINEAIRE |
| German | PROGNOSE.LINEAR |
| Hungarian | ELŐREJELZÉS.LINEÁRIS |
| Italian | PREVISIONE.LINEARE |
| Norwegian (Bokmål) | PROGNOSE.LINEÆR |
| Polish | REGLINX.LINIOWA |
| Portuguese (Brazil) | PREVISÃO.LINEAR |
| Portuguese (Portugal) | PREVISÃO.LINEAR |
| Russian | ПРЕДСКАЗ.ЛИНЕЙН |
| Spanish | PRONOSTICO.LINEAL |
| Swedish | PROGNOS.LINJÄR |
| Turkish | TAHMİN.DOĞRUSAL |