Demand Forecasting Calculator

This calculator uses two standard demand forecasting methods: simple moving average and linear trend (least squares regression). Enter up to 12 periods of historical sales data separated by commas, select your moving average window, and the calculator returns the next-period forecast from both methods. Use the moving average for stable demand and the linear trend for products with consistent growth or decline.

Enter monthly or weekly sales units, oldest first
Number of most recent periods to average (e.g., 3 for 3-period SMA)
141.67
153.57
126.88
+6.43 units

Demand forecasting formulas

SMA Forecast = Sum of last N periods / N

Linear Trend: y = a + b*t, where b = (n*Sum(t*y) - Sum(t)*Sum(y)) / (n*Sum(t^2) - Sum(t)^2)

Forecast for next period = a + b*(n+1)

In the linear trend formula, t is the period index (1, 2, 3, ...), y is the sales value, n is the number of periods, a is the intercept, and b is the slope (units per period). These are standard least squares regression formulas.

Choosing a forecasting method

  • Simple moving average works well for stable demand with no clear trend. A shorter window reacts faster to recent changes; a longer window is smoother but slower to respond.
  • Linear trend forecasting works best when sales have a consistent upward or downward trend over time.
  • Neither method handles seasonality well. For seasonal products, use seasonal decomposition or exponential smoothing with seasonal adjustment.
  • Always compare your forecast to your actual outcome and track MAPE over time to improve your approach.
  • Combine forecast methods by averaging them for a more robust estimate when you are uncertain which method is best.

Demand forecasting: frequently asked questions

What is demand forecasting?

Demand forecasting is the process of estimating future customer demand for a product or service based on historical data and other relevant factors. Accurate forecasts help businesses plan production, manage inventory, allocate marketing spend, and schedule staffing.

What is a simple moving average forecast?

A simple moving average (SMA) forecast averages the most recent N periods of data to predict the next period. For example, a 3-period SMA takes the average of the last three months of sales. It smooths out short-term fluctuations but lags behind trends.

What is linear trend forecasting?

Linear trend forecasting fits a straight line through historical data using linear regression, then extends that line to project future values. It captures an underlying growth or decline trend but assumes the trend continues at the same rate, which may not hold for seasonal or cyclical businesses.

How many periods of data do I need for a reliable forecast?

As a minimum, use at least twice as many historical periods as the number of periods you are forecasting ahead. For a 3-month forecast, use at least 6 months of history. More data generally produces more reliable trend estimates, especially for identifying seasonal patterns.

What is the mean absolute percentage error (MAPE)?

MAPE measures forecast accuracy as the average absolute percentage difference between the forecast and actual values. A MAPE of 10% means forecasts are off by 10% on average. Lower MAPE indicates better accuracy. It is defined as: MAPE = (1/n) x sum(|Actual - Forecast| / Actual) x 100.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 14 June 2026. See our methodology.