Guides
Stockouts Are Hiding Your Real Demand: How to Fix Your Sales Average
If a product sold out for part of last month, its sales average is too low, and the order you build from it will be too small. The fix is one change to the arithmetic: divide by the days the product was in stock, not by every day.
The short answer
Divide the units a product sold by the days it was actually in stock, not by every day in the period. A day that ended sold out leaves the count, and so do the sales made on it. Example: 60 units over 30 days, with 10 days sold out, is 3 a day, not 2.
Why does a stockout make your next order too small?
Your sales history records what customers bought, and customers can only buy what you have. On a day a product is sold out, the sales column shows zero, but nobody stopped wanting it. That zero describes your stock, not your customers. Forecasting researchers make the same point: zero sales during a stockout are not information about demand, and should be treated as missing (Fildes, Kolassa and Ma, 2022).
Most reorder sheets do something simple: units sold in the last 30 days, divided by 30. Every sold-out day adds a zero to that average and pulls it down. A lower average gives a smaller order. A smaller order sells out sooner, which adds more zeros to next month’s average. That is the loop: stockout, low sales, low average, small order, stockout again. The way out is the one Nicolas Vandeput argues for: forecast demand, not sales (Demand Forecasting Best Practices, chapter 3).
The products this hurts most are your best sellers, because they are the ones that sell out. Merchants who moved off Stocky have noticed it too: in a Shopify Community thread on reorder triggers, several replies point out that dividing by 30 counts sold-out days as zero demand, so the best sellers get under-ordered.
How do you calculate a sales average that ignores stockout days?
Two words first. Demand is what customers wanted. Sales are the part of demand you had stock for. A forecast should learn from demand, and on in-stock days sales are a fair record of it.
So the daily sales rate (also called sales velocity) is:
The formula
Daily sales rate = units sold on in-stock days ÷ number of in-stock days
An in-stock day is a day that ended with stock left to sell. Count the period you normally use (30, 60 or 90 days), take out every day that ended sold out, and divide only by the days that remain.
A worked example: from the sales column to the order
Example: a store sells a canvas tote bag. In the last 30 days the tote sold 60 units. It was sold out for 10 of those days, so all 60 units sold on the other 20. The supplier needs 21 days to deliver, the store orders from it every 14 days, and it keeps 7 days of safety stock (extra stock for slower deliveries or busier weeks). That means each order has to cover 21 + 14 + 7 = 42 days of sales. Today there are 70 totes on hand and none on order.
| Step | Every day counted | In-stock days only |
|---|---|---|
| Daily sales rate | 60 ÷ 30 = 2 a day | 60 ÷ 20 = 3 a day |
| Units needed for 42 days | 2 × 42 = 84 | 3 × 42 = 126 |
| Order now | 84 − 70 on hand = 14 | 126 − 70 on hand = 56 |
The plain average orders 14 totes. The in-stock average orders 56. That is four times as much, from the same sales history.
Which one is right? Customers buy about 3 a day when the tote is on the shelf. With the 14-unit order, the store has 84 totes to last 42 days. At 3 a day they last 28 days. The next delivery lands on day 35, so the tote is sold out for a week: about 21 sales lost. Those 7 sold-out days go straight into next month’s average, which makes the next order smaller still. The 56-unit order breaks the loop.
What about the day a product sold out?
Most stockouts don’t start at midnight. A product sells 4 units in the morning, runs out at lunch, and the shop stays empty all afternoon. That day’s sales are real, but they under-record what customers wanted, because half the day was lost.
The cleanest rule: a day that ends with no stock left is a sold-out day, and its sales leave the average with it. Keeping the sales but dropping the day would inflate the rate; keeping both would drag it down. Dropping both keeps the average to whole days of normal selling.
Example: in another 30-day period, the tote ended 8 days with no stock and sold 12 units on those days, plus 60 units on the other 22 days. The daily rate is 60 ÷ 22 = 2.73 a day, not 72 ÷ 22 = 3.27.
One exception. If you let customers keep buying when stock reaches zero (selling while out of stock, for a backorder or a preorder), those days were not really sold out: customers could still order, and they did. Count them as in-stock days.
How to do it in a spreadsheet
You need one row per product per day, with three columns:
- Column A: the date.
- Column B: units sold that day.
- Column C: stock left at the end of that day.
For 30 days in rows 2 to 31, the daily sales rate is:
=SUMIFS(B2:B31, C2:C31, ">0") / COUNTIF(C2:C31, ">0")
SUMIFS adds the units sold only on days that ended with stock left. COUNTIF counts those days. A day that ended at zero drops out of both, which is the rule above. The formula works the same way in Google Sheets and Excel.
The harder part is column C. Your sales history tells you what sold each day; it may not tell you what was left at the end of each day. If you don’t have that record, start keeping it today: one stock export per day, per product, is enough. Until you have a few weeks of it, mark the days you know a product was sold out by hand. A rough list of sold-out days is much better than none, because every one of them is currently counted as a day nobody wanted the product.
When there aren’t enough in-stock days
The fix has a limit. If a product was sold out for 25 of the last 30 days, its rate comes from 5 days, and 5 days can say almost anything. One big order or one quiet weekend swings the result.
When few in-stock days remain, don’t trust the number on its own:
- Use a longer period. Go back 60 or 90 days, so the rate comes from more days the product was actually on sale.
- Borrow a similar product’s rate. Another color or size of the same item, or the product it replaced, if that one stayed in stock.
- Check by hand before you order. The products that sell out most often are exactly the ones whose history is thinnest, and the ones where a wrong order costs the most.
It also helps to clean the in-stock days themselves. A one-off wholesale order, a clearance sale or a test order is not normal demand either. Take those out before you divide, or they inflate the rate the same way stockouts deflate it.
How Assisty does this
Assisty can leave out the days a product was out of stock, so a stockout doesn’t shrink your next order. It skips them unless you choose otherwise. The setting is Days you were out of stock, with two choices: “Skip them (treat as missing data)” or “Count as zero sales”. It applies to Reorder (formerly the Buying Table), Forecasting, Today, the Buying Calendar and product pages. It does not change Buy Plan quantities, so check those against the method above.
In Reorder, each suggested quantity sits next to the product’s stock, incoming stock, days left and reorder date, so you can check it against your own sheet.
Summary
- A sold-out day records zero sales, not zero demand. Counting it pulls your average down.
- A low average makes a small order, which sells out sooner and lowers the next average again.
- Daily sales rate = units sold on in-stock days ÷ number of in-stock days.
- A day that ended sold out leaves the average, and so do its sales.
- In a sheet:
=SUMIFS(units, end stock, ">0") / COUNTIF(end stock, ">0"), with one row per day. - When only a few in-stock days remain, use a longer period or a similar product’s rate, and check by hand.
FAQ
Should out-of-stock days count as zero sales in a forecast?
Usually not. On a sold-out day customers could not buy, so a zero tells you about your stock, not their demand. Leave those days out of the average, along with any sales made on a day that ended sold out.
How do I calculate average daily sales with stockouts?
Add up the units sold on days that ended with stock left, and divide by the number of those days. In a sheet with units sold in column B and end-of-day stock in column C: =SUMIFS(B:B, C:C, ">0") / COUNTIF(C:C, ">0").
What if a product was out of stock for most of the period?
Then the few in-stock days left are too thin to trust. Use a longer period, or borrow the rate of a similar product that stayed in stock, and check the result by hand before you order.
Do I need daily stock history to do this?
You need to know which days each product ended sold out. A daily record of stock at the end of the day is enough. If you do not keep one, start today, and until then mark the sold-out days you know about by hand.