Forecast Equation in Excel: How to Build One

How-to basics · Updated November 23, 2026

The simplest forecast equation in Excel is a linear trend line of the form y = mx + b, which you can create with the FORECAST.LINEAR function or by adding a trendline to a chart. For example, if your historical sales are in B2:B13 and your period numbers are in A2:A13, the formula =FORECAST.LINEAR(14, B2:B13, A2:A13) predicts the value for period 14 by fitting a straight line through the existing data. This article explains how to build that equation, how to extend it to exponential or moving-average forecasts, and how to avoid the common mistakes that make Excel forecasts misleading.

What the FORECAST.LINEAR Function Does

FORECAST.LINEAR (available in Excel 2016 and later, including Microsoft 365) calculates a predicted value using least-squares linear regression. It takes three arguments: the x-value you want to forecast for, the known y-values (your historical data), and the known x-values (the time periods or independent variables). The function fits a line y = mx + b to the data and returns the y-value on that line for the given x.

For instance, suppose you have monthly sales in cells B2:B13 for months 1 through 12 in A2:A13. To forecast month 13, enter:

=FORECAST.LINEAR(13, B2:B13, A2:A13)

If the data is perfectly linear, the result matches the trendline. In practice, the result is the point on the best-fit line, not an average of past values. The function ignores blank cells and text, but it requires that the x and y ranges have the same number of data points.

For older versions of Excel, the equivalent function is FORECAST, which works identically. In Excel 2016 and later, FORECAST is still available for compatibility, but Microsoft recommends FORECAST.LINEAR.

How to Get the Full Equation: SLOPE and INTERCEPT

If you need the actual equation—the slope and intercept—use the SLOPE and INTERCEPT functions. With the same data layout (x in A2:A13, y in B2:B13), the slope is:

=SLOPE(B2:B13, A2:A13)

and the intercept is:

=INTERCEPT(B2:B13, A2:A13)

Then you can write the equation as y = slope * x + intercept. For example, if slope is 2.5 and intercept is 10, the forecast for x=13 is =2.5*13+10, which equals 42.5. This is exactly what FORECAST.LINEAR returns.

To see the equation on a chart, create a scatter plot of your data, right-click the trendline, select Format Trendline, check Display Equation on chart and Display R-squared value on chart. The R-squared value tells you how well the line fits—closer to 1 means a better fit.

Choosing the Right Forecast Method

Linear forecasting works only when your data follows a roughly straight-line trend. If your data has seasonality (e.g., retail sales peak every December), a linear forecast will miss those peaks. If the data grows exponentially (e.g., viral adoption), a linear line will under-predict future values.

Excel offers several built-in forecasting tools beyond simple linear regression:

  • Exponential smoothing – Use the FORECAST.ETS function, which handles seasonality and trends. For monthly data with yearly seasonality, the formula is =FORECAST.ETS(target_date, values, timeline, seasonality, ...). It requires a timeline with equally spaced dates.
  • Moving average – Use the AVERAGE of the last n periods. For a 3-month moving average, =AVERAGE(B10:B12) predicts the next month. This smooths random fluctuations but lags behind trends.
  • Exponential trend – Fit a curve by taking the natural log of the y-values, then use FORECAST.LINEAR on the logged data, then exponentiate the result. This is effectively a log-linear model.

To decide, plot your data first. If the points look like a straight line, use linear. If they curve upward, try exponential. If there’s a repeating pattern, use FORECAST.ETS with seasonality set to the number of periods per cycle (e.g., 12 for monthly yearly seasonality).

How to Build a Forecast Sheet in Excel

Excel has a dedicated tool that creates a forecast worksheet automatically, including a chart and a table of predicted values with confidence intervals. To use it:

  1. Select your data (both the time column and the value column).
  2. Go to Data > Forecast Sheet (in the Forecast group).
  3. In the Create Forecast Worksheet dialog, choose a forecast end date and check the options for seasonality and confidence interval.
  4. Click Create. Excel inserts a new worksheet with a line chart and a table of forecasted values.

This tool uses the FORECAST.ETS algorithm behind the scenes. It’s ideal for time-based data with dates, because it automatically detects seasonality and provides upper and lower confidence bounds. The forecast table includes columns for the predicted value and the confidence interval range.

Common Problems and How to Fix Them

Several issues trip up users when creating forecast equations:

  • #VALUE! error – This occurs if your x and y ranges are not the same size, or if any cell contains text or an error. Check that both ranges have the same number of rows.
  • #N/A error – With FORECAST.ETS, this happens if the timeline has duplicate dates or is not sorted. Ensure dates are unique and in ascending order.
  • Forecast is too low or too high – Usually because the linear model doesn’t fit the data. Try a different method or check if there are outliers. Remove extreme values that are not representative of the trend.
  • Seasonality not detected – FORECAST.ETS may miss seasonality if your data is short. Provide at least two full cycles (e.g., 24 months for yearly seasonality).
  • Forecast goes negative – If your data is always positive (like sales), a linear trendline can dip below zero. Use an exponential or a constrained method, or set a floor in your formula.

A common misconception is that the forecast equation is a guarantee. In reality, it’s a statistical estimate based on past patterns. The further you forecast into the future, the wider the confidence interval, and the less reliable the number.

Comparing FORECAST.LINEAR, FORECAST.ETS, and Moving Average

Each method has strengths and weaknesses:

  • FORECAST.LINEAR – Simple, fast, and easy to explain. Best for data with a clear linear trend and no seasonality. It treats all past points equally, so old outliers can skew the result.
  • FORECAST.ETS – More sophisticated. It weighs recent points more heavily, detects seasonality, and provides confidence intervals. Requires a date or time timeline with consistent intervals. Available in Excel 2016 and later.
  • Moving average – Extremely simple, but it lags behind trends and doesn’t extrapolate beyond the last average. It’s useful for smoothing noise, but not for long-term forecasting.

For example, if you have 24 months of data with a clear upward trend and a yearly seasonal spike, FORECAST.ETS will capture both. A linear forecast would miss the spike and under-predict. A moving average would smooth the spike and also under-predict the next month if the trend is rising.

Frequently Asked Questions

How do I forecast in Excel without a date column?

You can still use FORECAST.LINEAR by using a simple period number as the x-value. Create a column with 1, 2, 3, … for each data point, then use that as the known x’s. For the forecast x, use the next number in the sequence. This works for any evenly spaced data.

What is the difference between FORECAST and FORECAST.LINEAR?

They are identical in function. FORECAST is the original name, kept for compatibility with older Excel versions. FORECAST.LINEAR was introduced in Excel 2016 to make the method explicit and to differentiate it from FORECAST.ETS (exponential smoothing). Both use the same linear regression calculation.

Why does my forecast show a straight line even though my data is seasonal?

That means you are using a linear method (FORECAST.LINEAR or a linear trendline). To capture seasonality, switch to FORECAST.ETS or the Forecast Sheet tool, which automatically detects and models seasonal patterns. Make sure your timeline has complete cycles—at least two years of monthly data for yearly seasonality.

Can I force a forecast to be non-negative?

Yes. Wrap your forecast formula with MAX to set a floor. For example, =MAX(0, FORECAST.LINEAR(13, B2:B13, A2:A13)) returns 0 if the linear forecast is negative. This is a common workaround for data that logically cannot be negative, like sales or inventory.

How many data points do I need for a reliable forecast?

There is no fixed number, but more points generally improve accuracy. For linear regression, at least 3 points are needed to fit a line, but 10 or more is better. For FORECAST.ETS with seasonality, you need at least two full cycles (e.g., 24 months for monthly data). The confidence interval widens as you forecast further into the future, so the reliability decreases.

Final Thoughts on Forecast Equations

Building a forecast equation in Excel is straightforward with the built-in functions. Start by plotting your data to see the pattern, then choose the method that matches: linear for steady trends, FORECAST.ETS for seasonality, and moving average for short-term smoothing. Always check the R-squared value or confidence intervals to gauge reliability, and remember that any forecast is an estimate, not a certainty. For financial or business decisions, consult a qualified professional.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.