Your partner asks, "What will Q3 look like?" You open Shopify, glance at the last few months, and give a number that is equal parts math and hope. The problem is not a lack of data. Your Shopify admin has two or three years of order history sitting there. The problem is turning that data into a forecast you can actually plan against. This tool takes your orders export, identifies your seasonal patterns and growth trend, and projects revenue month by month with confidence intervals, so you can plan inventory, marketing spend, and cash flow with numbers instead of guesses.
Worked Example: A Simulated Revenue Forecast
Question: How can a shop turn a monthly revenue forecast into a purchase budget?
Data: Simulated data, seed 42: 36 monthly revenue totals in dollars. The data build in a straight-line trend (100,000 dollars plus 2,000 a month) multiplied by a seasonal factor for each month, plus random noise with a standard deviation of 4,000. They contain no promotions, stock limits or changes in customer demand.
Method: The seasonal swing in these data grows with the level of sales, so the script fits a straight line multiplied by a factor for each month, using alternating least squares. It projects the next 3 months and multiplies each forecast by an assumed 30% purchase share to get a sample budget. The interval is an approximate model-based prediction interval. It comes from the spread of the residuals and assumes independent, normal, constant-variance errors; it does not account for the chosen model being the wrong shape. An additive fit (month effects added to a line) would be the wrong shape for these data.
import numpy as np
# Simulated monthly revenue in dollars, generated with a fixed seed.
seed = 42
rng = np.random.default_rng(seed)
n = 36
t = np.arange(n, dtype=float)
season = np.array([0.82, 0.84, 0.93, 0.97, 1.00, 1.02,
1.04, 1.03, 1.00, 1.08, 1.22, 1.28])
revenue = 100_000 + 2_000 * t
revenue *= season[np.arange(n) % 12]
revenue += rng.normal(0, 4_000, n)
# Multiplicative model: revenue = (a + b x t) x seasonal factor for the month.
# Fit it by alternating: fit the line to revenue divided by the factors,
# then re-estimate the factors from revenue divided by the line.
month = np.arange(n) % 12
factor = np.ones(12)
for _ in range(50):
slope, intercept = np.polyfit(t, revenue / factor[month], 1)
line = intercept + slope * t
factor = np.array([np.mean(revenue[month == m] / line[month == m])
for m in range(12)])
factor = factor / factor.mean()
fitted = (intercept + slope * t) * factor[month]
resid = revenue - fitted
resid_sd = np.sqrt(np.sum(resid ** 2) / (n - 13))
h = np.arange(n, n + 3, dtype=float)
future_month = np.arange(n, n + 3) % 12
forecast = (intercept + slope * h) * factor[future_month]
# Approximate 95% prediction interval; assumes independent, normal,
# constant-variance errors.
lo = forecast - 1.96 * resid_sd
hi = forecast + 1.96 * resid_sd
# Purchasing illustration: assume inventory cash budget is 30% of forecast.
purchase_ratio = 0.30
budget = forecast * purchase_ratio
print(f"Simulated data, seed {seed}")
print(f"Input: {n} monthly revenue totals, dollars; "
"first month=$100,000 before season and noise")
print("Method: linear trend times a seasonal factor for each month, "
"fitted by alternating least squares; forecast next 3 months")
print(f"Residual standard deviation=${resid_sd:,.0f}")
built_in = (100_000 + 2_000 * h) * season[future_month]
print("Built-in revenue before noise for the next 3 months: "
+ ", ".join(f"${v:,.0f}" for v in built_in))
print("Forecasts and approximate 95% prediction intervals:")
for i, (point, lower, upper, buy) in enumerate(
zip(forecast, lo, hi, budget), start=1):
print(f"month +{i}: forecast=${point:,.0f}; "
f"interval=${lower:,.0f} to ${upper:,.0f}; "
f"purchase budget at 30%=${buy:,.0f}")
print("Limit: this synthetic series has a fixed seasonal pattern and does "
"not model promotions, stock limits, or changing customer demand.")
Printed output of the script above:
Simulated data, seed 42
Input: 36 monthly revenue totals, dollars; first month=$100,000 before season and noise
Method: linear trend times a seasonal factor for each month, fitted by alternating least squares; forecast next 3 months
Residual standard deviation=$3,018
Built-in revenue before noise for the next 3 months: $141,040, $146,160, $163,680
Forecasts and approximate 95% prediction intervals:
month +1: forecast=$142,663; interval=$136,748 to $148,578; purchase budget at 30%=$42,799
month +2: forecast=$146,765; interval=$140,850 to $152,680; purchase budget at 30%=$44,029
month +3: forecast=$168,682; interval=$162,766 to $174,597; purchase budget at 30%=$50,604
Limit: this synthetic series has a fixed seasonal pattern and does not model promotions, stock limits, or changing customer demand.
Result: The forecasts are $142,663, $146,765 and $168,682 against built-in noise-free levels of $141,040, $146,160 and $163,680, and each approximate interval contains its built-in level in this run. The sample budgets are $42,799, $44,029 and $50,604. Treat each budget as a starting point: the 30% share is an assumption, not a buying rule. The fit is close because the model has the same shape as the data. Real orders can contain effects this model does not include.
Limit: This simulated series has a fixed seasonal pattern and does not model promotions, stock limits, or changing customer demand.
Sources
- Hyndman RJ, Koehler AB, Snyder RD, Grose S (2002). A state space framework for automatic forecasting using exponential smoothing methods. International Journal of Forecasting. doi:10.1016/S0169-2070(01)00110-8. Covers: who published the state space (ETS) framework, and when.
- Ljung GM, Box GEP (1978). On a measure of lack of fit in time series models. Biometrika. doi:10.1093/biomet/65.2.297. Covers: who published the Ljung-Box test, and when.
What Is Revenue Forecasting?
Revenue forecasting takes your historical sales data, finds the patterns in it (long-term growth or decline, repeating seasonal cycles, and irregular fluctuations) then projects those patterns forward to generate month-by-month revenue predictions. The engine behind this analysis is ETS (Error, Trend, Seasonality) exponential smoothing, one of the most widely used forecasting methods in both academic research and corporate finance.
The core idea is intuitive. Your revenue is not random. It is shaped by forces that repeat: holiday shopping spikes in November and December, summer slowdowns, back-to-school demand in August. ETS separates these repeating patterns from the underlying trend (is your business growing 8% year-over-year or flattening?) and from the noise (a one-off viral social media post or a supply chain disruption). Once those components are isolated, the model extends them into the future.
What makes this different from drawing a line through your data in Excel is statistical rigor. The model does not just give you a single number for next month. It gives you a confidence interval. A forecast of $420,000 with an 80% confidence interval of $380,000 to $460,000 means you can plan for the pessimistic scenario ($380K) in conservative budgets while knowing the upside could reach $460K. That range is what turns a guess into a planning tool. The algorithm selects an ETS model variant for your data using AIC (Akaike Information Criterion), which balances fit against model complexity.
When to Use Revenue Forecasting
- Quarterly or annual budget planning. Instead of saying "we grew 12% last year so let's plan for 15%," you get a forecast that accounts for which months carry the growth and which months are seasonally weak. A forecast that says Q1 will be $1.2M and Q3 will be $900K is far more useful for resource allocation than an annual number divided by four.
- Inventory and purchasing decisions. If you know revenue will peak at $600K in November but drop to $350K in February, you can plan inventory purchases and staffing accordingly. The category-level breakdowns make this even more actionable, if Electronics drives 60% of the November spike but Apparel is flat, you know where to concentrate preparation.
- Cash flow management. Knowing your revenue trajectory three to six months out lets you time inventory purchases, plan marketing spend, and manage payroll without surprises. The confidence intervals give you conservative, expected, and optimistic scenarios to model against.
- Investor or partner reporting. "Based on 24 months of order data, our forecast for Q3 is $1.4M with a 95% confidence range of $1.2M to $1.6M" tells a more credible story than a hockey stick slide with no uncertainty quantification. The report produces board-ready charts with confidence bands.
- Marketing spend timing. The seasonal decomposition shows exactly when your peak and trough months are, and whether the peaks are growing or shrinking relative to baseline. If your November spike has been growing 15% year-over-year while baseline growth is only 5%, you should be investing more in Q4 marketing and inventory each year.
What Data Do You Need?
At minimum, you need a CSV with two columns: a date column (order date, transaction date, invoice date: any timestamp associated with each sale) and a numeric revenue column (the dollar amount or sales total). The tool aggregates your transaction-level records into monthly totals automatically, so you do not need to pre-aggregate anything. Whether you have one row per order or one row per line item, the tool handles the rollup.
Where to get the export
- Shopify: Settings > Data > Export > Orders. Select "All orders" and export as CSV. The Created at and Total columns are all you need.
- WooCommerce: WooCommerce > Reports > Export Orders CSV. Map order date and order total.
- Stripe: Dashboard > Payments > Export. You get date and amount per payment.
- Square, PayPal, or any other processor: Any CSV with a date and an amount per transaction will work.
How much history
More years of history give steadier seasonal estimates, because the model can compare each December with earlier Decembers to tell a genuine spike from a one-time event. The worked example above uses three years. Data with fewer than 12 months will likely fail to produce a seasonal model, and the tool will flag this. If you have only 6 to 12 months, the tool will still produce a trend forecast, but without the seasonal decomposition.
Optional columns that unlock more
A category column (product category, department, or brand) enables per-category trend breakdowns so you can see which segments are growing and which are declining. A region column produces geographic breakdowns. These are not required but make the analysis significantly more actionable for stores with multiple product lines.
Data format
Date formats are flexible: the tool handles YYYY-MM-DD, MM/DD/YYYY, DD/MM/YYYY, and most common formats. Revenue values should be numeric. If your data contains returns or refunds as negative values, those are fine. They net against positive sales during monthly aggregation. However, if entire months net to zero or negative, the model switches to an additive configuration automatically.
How to Read the Report
Revenue Forecast Chart: The centerpiece. It shows your historical monthly revenue as a solid line, then extends into the future with point forecasts and shaded confidence bands. The narrower inner band is the 80% interval. Both bands are model-based prediction intervals; their stated coverage depends on the model assumptions and may differ in practice. The wider outer band is the 95% interval. Use the 80% band for operational planning (inventory purchases, staffing) and the 95% band for stress testing (can we make payroll if revenue hits the floor?).
Seasonal Decomposition: Breaks your revenue into three components. The trend line shows long-term direction stripped of seasonal noise: is your business genuinely growing, flat, or declining? The seasonal component shows the repeating pattern, which months are consistently above or below average, and by how much. The remainder captures everything else: one-off events, measurement noise, anomalies. Large spikes in the remainder point to months where something unusual happened (a viral product, a supply chain disruption, a major sale).
Category Trends: Monthly revenue broken down by product category (if you mapped one). This reveals which categories drive overall growth and which are dragging. If total revenue is up 10% but that growth is entirely concentrated in one category while others are flat or declining, this chart makes it obvious. Use this for purchasing decisions and product development priorities.
Executive Summary: The AI-generated TL;DR distills the analysis into key findings: the overall revenue trajectory, the forecast for the next six months, the strength of seasonal patterns, and the model's accuracy. This is the card you paste into your board deck or partner update.
Forecast Detail Table: Lists each forecasted month with the point estimate, lower bound, and upper bound. This is the table you paste into your budget spreadsheet. Each row is a month, each column is a number you can plan against.
Model Performance: Reports how well the ETS model fits your historical data. The key metric is MAPE (Mean Absolute Percentage Error): the average percentage the model was off when predicting months it already knew about. A lower MAPE means the model tracked the history more closely. The Ljung-Box test (published by Ljung and Box in 1978) checks whether the model's residuals show remaining autocorrelation. A p-value above 0.05 means the test did not detect statistically significant residual autocorrelation at the chosen settings. It does not show that every pattern was captured.
What to Do With the Results
Inventory planning
Use the forecast detail table to set purchasing budgets by month. The worked example above shows how to turn a forecast into a sample purchase budget; its budget share is an assumption, not a buying rule. The confidence intervals let you decide how aggressive to be: ordering to the upper bound risks overstock, ordering to the lower bound risks stockouts.
Marketing spend allocation
The seasonal decomposition shows which months have the strongest demand. Concentrate your ad spend, email campaigns, and product launches in months where organic demand is already high. You are pushing with the current, not against it. If your data shows December is consistently 2.3x your average month, that is where the extra marketing dollar has the highest marginal return.
Cash flow management
Map the forecast's lower-bound scenario against your fixed costs (rent, payroll, SaaS subscriptions) month by month. If the pessimistic scenario for March falls below your burn rate, that is a month where you need a cash reserve or a line of credit. This simple exercise prevents the scenario where a growing e-commerce business runs out of cash in a slow month.
Set realistic targets
The forecast gives you a data-driven baseline for revenue targets. If the model projects $420K for June based on historical patterns, setting a target of $600K requires a specific plan for the $180K gap: a new product launch, a marketing push, a price increase. Without the baseline, targets are either sandbags or fantasies. With the baseline, every target becomes an explicit growth plan.
When to Use Something Else
- Want to understand what drives revenue, not just predict it: This forecast is purely historical. It extrapolates patterns from the past. It cannot tell you that a 10% increase in ad spend will produce a 5% revenue lift. For causal questions like "what happens if we change pricing?" or "how much does marketing spend affect revenue?", use Ridge Regression or Lasso Regression instead.
- Want more control over the model: If you want custom differencing, exogenous variables (like ad spend as an input), or manual order selection, use the ARIMA module. ARIMA is more flexible but requires more statistical knowledge. This tool handles model selection automatically.
- Have less than 12 months of data: Time series forecasting needs history to find patterns. With very short histories, use a simple trend analysis to visualize the direction without committing to a formal forecast.
- Want to forecast individual product demand: This tool works best at the aggregate or category level. SKU-level forecasting with hundreds of products requires specialized demand planning tools that handle intermittent demand and long-tail products differently.
- Want to understand your customers, not your revenue: If the question is "who are my best customers?" rather than "what will revenue look like?", use RFM customer segmentation to classify customers by value and engagement.
Your turn
Bring your own data and the question you actually need answered.
MCP AnalyticsData science by email Send us your data and your question, and we will reply. ds@mcpanalytics.ai