The quickest way to forecast a linear trend in Excel is to use the FORECAST.LINEAR function: =FORECAST.LINEAR(x, known_y's, known_x's). For example, if your historical sales are in B2:B13 and the corresponding periods are in A2:A13, then =FORECAST.LINEAR(14, B2:B13, A2:A13) returns the predicted value for period 14. This function fits a straight line through your data using the least-squares method and projects it forward.
What Does Linear Forecasting Mean in Excel?
Linear forecasting assumes your data follows a straight-line trend over time. Excel calculates the line of best fit (y = mx + b) from your known x and y values, then uses that line to estimate a future y for a given x. The FORECAST.LINEAR function replaced the older FORECAST function in Excel 2016, but both still work in Microsoft 365. If you see FORECAST in older tutorials, it behaves identically.
Excel also offers a visual way to forecast: select your chart, go to Chart Design (or Chart Tools) > Add Chart Element > Trendline > Linear, then extend the trendline forward by a set number of periods. However, the function gives you a numeric value you can use in formulas, which is more flexible for reports and dashboards.
How to Use FORECAST.LINEAR Step by Step
Assume you have monthly sales data: months 1–12 in column A (A2:A13) and sales in column B (B2:B13). To forecast month 13:
- Click an empty cell, say D2.
- Type
=FORECAST.LINEAR(13, B2:B13, A2:A13). - Press Enter. Excel returns the predicted sales for month 13.
The arguments are:
- x – the data point (period) you want to forecast for. It can be a number or a cell reference.
- known_y’s – the range of dependent values (e.g., sales).
- known_x’s – the range of independent values (e.g., time periods).
If your x values are dates, Excel treats them as serial numbers, so the function still works. For example, with dates in A2:A13 and sales in B2:B13, =FORECAST.LINEAR(DATE(2025,1,1), B2:B13, A2:A13) returns the forecast for January 1, 2025.
On Mac, the function works exactly the same. In Excel for the web, it also works, but you may need to use commas as separators depending on your regional settings (semicolons in some locales).
Choosing Between FORECAST.LINEAR and Other Functions
Excel has several forecasting functions, and picking the right one matters:
- FORECAST.LINEAR – best for data with a steady linear trend and no strong seasonality.
- FORECAST.ETS – uses exponential smoothing to handle seasonality and trends. It’s better for monthly sales with holiday spikes.
- TREND – returns multiple predicted values as an array. Use it when you need forecasts for several periods at once.
- LINEST – returns the slope and intercept, which you can use to build your own formula.
For example, if your data shows a clear upward trend but also a repeating yearly pattern, FORECAST.ETS will likely be more accurate. If your data is simple and linear, FORECAST.LINEAR is simpler to explain and debug.
Common Problems and How to Fix Them
Several issues can trip up users:
- #N/A error – the known_x’s and known_y’s ranges have different lengths. Make sure they match.
- #VALUE! error – the x value is non-numeric or the ranges contain text. Check for blank cells or text entries.
- #DIV/0! error – the known_x’s have zero variance (all identical). Linear regression needs at least two distinct x values.
- Wrong results – if your x values are not sorted, Excel still works but the trend may be misleading. Sort data by x before forecasting.
Another common misconception: FORECAST.LINEAR does not require your x values to be equally spaced, but it assumes a linear relationship. If your data curves, the forecast will be off. Check by plotting the data and adding a linear trendline to see how well it fits.
Comparing Linear Forecast with a Trendline Chart
If you want to visualize the forecast, a trendline is helpful. Right-click a data series in a scatter or line chart, select Add Trendline, choose Linear, then in the Format Trendline pane set “Forward” to the number of periods. You can also check “Display Equation on chart” to see the y = mx + b formula. This is a quick way to eyeball the trend, but it doesn’t give you a cell value you can use in other calculations. For that, use the function.
Note that the trendline equation uses the same least-squares method as FORECAST.LINEAR, so the numbers will match if you use the same data and x values.
Cost and Availability
FORECAST.LINEAR is available in all modern versions of Excel, including Microsoft 365, Excel 2021, Excel 2019, and Excel 2016. It is also in Excel for the web and Excel for Mac. There is no extra cost beyond your Excel subscription or license. Older versions (Excel 2013 and earlier) use FORECAST instead, which works the same way. If you are using a free alternative like Google Sheets, the equivalent function is FORECAST, with the same syntax.
Alternatives to Linear Forecasting
Linear forecasting is not always the best choice. If your data has a clear exponential growth pattern, you might use GROWTH or apply a logarithmic trendline. If you have seasonality, FORECAST.ETS is more robust. If you need to forecast multiple periods at once, you can use TREND as an array formula: select a range of cells, type =TREND(B2:B13, A2:A13, A14:A16), and press Ctrl+Shift+Enter (or just Enter in Microsoft 365) to get three forecasts. For more advanced modeling, you can use the Solver add-in to fit custom curves, but that’s overkill for most linear projections.
Remember that all forecasting is based on the assumption that past patterns continue. Linear forecasts are sensitive to outliers, so check your data for anomalies before relying on the result.
Frequently Asked Questions
Does FORECAST.LINEAR work with dates?
Yes. Excel stores dates as serial numbers, so you can use a date as the x argument. For example, =FORECAST.LINEAR(DATE(2025,6,1), B2:B13, A2:A13) works if A2:A13 contains dates. The result will be a numeric value that you can format as a number or currency, not a date.
What is the difference between FORECAST and FORECAST.LINEAR?
They are identical in function. FORECAST was the original name; Microsoft renamed it to FORECAST.LINEAR in Excel 2016 to clarify that it uses linear regression. Both are still supported, so you can use either.
Why does my forecast return a #DIV/0! error?
This happens when the known_x’s range has a variance of zero, meaning all x values are the same. Linear regression requires at least two distinct x values to calculate a slope. Check your x range for duplicates or a constant column.
Can I forecast more than one period at a time?
Yes, but FORECAST.LINEAR returns a single value. To forecast multiple periods, use TREND as an array formula, or write several FORECAST.LINEAR formulas for each x value. Alternatively, use the Forecast Sheet feature (Data > Forecast Sheet) to generate a table and chart with multiple future periods.
Is linear forecasting accurate for stock prices?
Generally no. Stock prices are volatile and do not follow a stable linear trend. Linear forecasting is best for stable processes like slowly growing sales or inventory usage. For financial data, consider using FORECAST.ETS or consult a qualified financial analyst. This article does not constitute financial advice.
How do I show the forecast on a chart?
Create a line or scatter chart from your historical data, right-click the data series, choose Add Trendline, select Linear, then in the Format Trendline pane set “Forward” to the number of periods you want to forecast. You can also check “Display Equation” to see the underlying formula.
Related
- Generate 3 Random Numbers: How to Do It
- How to Enter Data in RStudio: A Step-by-Step Guide
- Generate 2 Random Numbers: How to Do It
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Align Checkboxes in Excel: Step-by-StepTo align checkboxes in Excel, first identify whether they are in-cell checkboxes or floating objects. For in-cell checkboxes,…
- Just Saved Excel File? Where to Find It and Recover ItIf you just saved an Excel file and cannot find it, open Excel and check File > Open…
- Excel Import and Align with Existing TimesYes, Excel can import data and align it with existing times, but it depends on what you mean…
- Convert Text to Columns in Excel: Steps, Options & TipsTo convert text to columns in Excel for Microsoft 365 on Windows, select the cells in one column,…
- Project Activity Tracker Spreadsheet: Setup and TipsA project activity tracker spreadsheet is a shared, organized list of project tasks or activities, their owners, deadlines,…
- Customizable Calendar Template in Excel: How to Make OneYes. You can make a customizable calendar template in Excel by starting with a blank worksheet or adapting…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.