How to calculate lost sales from stockouts

Elie Dufeu, CTO and Co-Founder of Metreecs
Jean Jass
Head of communication
Share

By Elie Dufeu, CTO & Co-Founder, Metreecs. Published 24 November 2026.

To calculate lost sales from stockouts, estimate what the product would have sold while it was unavailable (expected daily demand multiplied by the days it was out), subtract what it actually sold in that window, then remove the units your shoppers bought as a substitute in the same store. Value what is left at unit margin, not at price, and you have the real cost of the stockout.

That sounds simple, and the multiplication is. The hard part is the expected demand. A shelf that sat empty for a week records zero sales, and zero is the one number you know is wrong. Every choice you make about the baseline, the stockout window, and substitution moves the answer, sometimes by a factor of two.

This guide walks through the calculation step by step, compares the three baselines planners use, shows how to net out substitution, and explains why lost sales from stockouts quietly pull your next forecast down if you leave them in the history. The examples use illustrative retailers and our own arithmetic. If you want to run the numbers on your own stores, you can check your stockout history with our team.

Key Takeaways

  • When a product is out of stock, 31% of shoppers go to another store, 26% switch to a different brand, and 9% buy nothing at all, according to the worldwide study published in 2002 by FMI, GMA, and CIES (71,000 shoppers in 29 countries).
  • The same study put the average loss for a typical retailer at about 4% of sales, and traced 47% of out-of-stocks to store ordering and forecasting.
  • Lost units equal expected demand during the stockout, minus actual sales, minus units recovered by in-store substitutes. In the worked example below, an 8.5-day stockout of a €49 frying pan costs 51 units gross and €802 of margin net.
  • Training a forecast on sales that include stockouts biases it low. On the FreshRetailNet-50K dataset (50,000 store-product series), recovering demand during stockouts cut a 7.37% underestimation to close to zero.
  • The baseline matters more than the formula. In the heatwave example, comparable stores point to 252 lost bags of charcoal where the pre-stockout run rate points to 120.

What are lost sales from stockouts?

Lost sales from stockouts are the units, revenue, or margin a retailer would have earned if a product had been available when shoppers wanted it. They never show up in the sales report, because the sale never happened. You estimate them by reconstructing demand for the period the product was missing.

Planners call the gap between demand and recorded sales censored demand. Sales equal demand only when stock is sufficient. When the shelf empties, sales stop at whatever stock there was, and the rest of the demand disappears from the data.

Two kinds of stockout matter for the calculation:

  • Full stockouts, where the product is gone from the store or the website for one or more whole days.
  • Partial stockouts, where it runs out partway through a day, or where some variants (a size, a color) are gone while others remain on the shelf.

Partial stockouts are easy to miss, because the product still records some sales. In our experience they account for a large share of the lost volume in fast movers, since a product that empties at 3 p.m. every Saturday never shows a zero.

How to calculate lost sales from stockouts in five steps

The method below estimates lost sales from stockouts for a single product in a single store, and you then add up across products and locations. It uses five steps, and each one has a choice that changes the result.

  1. Define the stockout window. Find when stock reached zero and when it came back. Use the time of the last sale before the gap and the receipt time of the next delivery. If you only have daily data, count a day as out of stock when the closing stock was zero and the opening stock of the next day was zero too.
  2. Estimate expected demand for that window. Pick a baseline: the run rate from recent in-stock days, the same weeks last year adjusted for trend, or the sales of comparable stores that stayed in stock. The next section compares them.
  3. Subtract actual sales during the window. For a full stockout this is zero. For a partial one, it is whatever sold before the shelf emptied or the variants that remained.
  4. Subtract units recovered by substitution. Measure the uplift of the closest substitutes in the same store during the window, against their own baseline. Those units stayed in your till.
  5. Value the result. Multiply lost units by unit margin to get the cost. Keep revenue as a second line for reporting, and track the basket effect separately if you can measure it.

Written as a formula:

Net lost units = (expected daily demand x days out of stock) minus actual sales in the window minus substitute uplift

Lost margin = gross lost units x unit margin, minus substitute uplift x substitute unit margin

A worked example: the frying pan that ran out

Nadia is the replenishment planner for an illustrative kitchenware chain with 18 stores. In late October, the 28 cm ceramic frying pan sold out in the flagship store at 2 p.m. on a Saturday. The next delivery arrived eight full trading days later.

In the four weeks before the stockout, the pan sold 168 units in the flagship, which is 6.0 units a day. About half of a typical day's pan sales happen after 2 p.m. in that store, so Nadia counts the first day as half a day lost. The stockout window is 8.5 days.

Meanwhile, the 24 cm version of the same pan usually sells 2.0 units a day. During those 8.5 days it sold 37 units instead of the 17 it would normally sell, an uplift of 20 units.

LineCalculationResult
Expected demand, 28 cm pan6.0 units x 8.5 days51 units
Actual sales in the windowshelf empty0 units
Gross lost units51 minus 051 units
Substitute uplift, 24 cm pan37 sold minus 17 expected20 units
Net lost units51 minus 2031 units
Gross lost revenue51 x €49€2,499
Gross lost margin51 x €22€1,122
Margin recovered by the substitute20 x €16€320
Net lost margin€1,122 minus €320€802

The headline "€2,499 of lost sales" is the number most reports would show. The cost to the business is €802, because 39% of the demand moved to a cheaper pan on the next hook and a stockout costs margin, not price. Nadia now ranks stockouts by net lost margin, and the frying pan sits behind several cheaper products that had no substitute on the shelf.

Choose the baseline before you calculate lost sales

The expected demand in step 2 drives the whole answer, and none of the three common baselines is right everywhere. Planners who calculate lost sales the same way for every product end up with numbers that look precise and are badly off for seasonal or trending items.

BaselineHow it worksStrengthsWeaknessesBest for
Run rate from in-stock daysAverage daily sales over the last two to four weeks the product was in stockSimple, uses the product's own recent dataMisses surges and seasonality, and is biased low if the period had partial stockoutsStable, steady sellers
Same period last yearLast year's sales for the same weeks, scaled by year-on-year trendCaptures seasonality and calendar eventsBreaks when last year also had a stockout, or for new productsSeasonal products with clean history
Comparable stores in stockSales of the same product in similar stores during the same days, scaled to this store's usual shareCaptures what happened that week (weather, promotion, local demand)Needs enough similar stores that stayed in stockMulti-store retailers, weather and event-driven products

Why the baseline can double the answer

Tomasz plans outdoor products for an illustrative chain of garden centers. In a June heatwave, barbecue charcoal sold out in one store for four days. Before the stockout, that store sold 30 bags a day, so the run-rate baseline gives 4 x 30 = 120 lost bags.

But the heatwave was the reason for the stockout. The chain's other stores that still had charcoal sold 2.1 times their normal rate that week. Applied to this store, expected demand was 63 bags a day, and lost sales from stockouts over the four days come to 252 bags.

The run rate assumed an ordinary week, and the stockout happened precisely because the week was not ordinary. One mistake we repeatedly see is a single company-wide baseline for every product, when demand that reacts to weather or promotions needs the comparable-store view.

When comparable stores are not available, a blend works: start from the run rate, then apply the uplift of the product's category in the same store during the window. It is less precise, and it at least reflects that the week was busy.

Substitution, walk-aways, and the basket

Not every unit counted in lost sales from stockouts is lost revenue for the store. The 2002 worldwide study by FMI, GMA, and CIES, which surveyed 71,000 shoppers in 29 countries, found that when an item was missing, 31% of shoppers went to another store and 26% bought a different brand. Another 9% bought nothing at all.

Those shares vary a lot by category and by how loyal shoppers are to a brand, so use them as a frame, not as a factor to multiply by. Your own data is better, and it is usually there:

  • In-store substitution shows up as uplift on close substitutes during the stockout window, as in the frying pan example. Pick two or three candidates per product (the next size, the same product in another color, the closest product from another brand) and measure each against its own baseline.
  • Delayed purchases show up as a spike just after the product returns. Count it as recovered demand only if it is clearly above the normal run rate.
  • Walk-aways are what remains: demand that left the store. These are the true lost sales from stockouts, plus whatever else those shoppers would have bought.

The basket effect is the hardest part to measure. A shopper who came for one missing item and left takes the rest of the basket too. If you can, compare basket size and transaction counts on stockout days with similar days, and report the result as a separate line rather than folding it into the per-product number.

Online, the same logic applies with better data. Count sessions on the out-of-stock product page during the window, multiply by the page's normal conversion rate, and you have expected orders. Then check whether visitors moved on to a substitute product page and bought it.

Why lost sales from stockouts distort the next forecast

A stockout costs you twice: once in the sales you missed, and again when the forecast learns from the depressed sales history. Most forecasting methods treat recorded sales as demand. A week with a stockout tells the model that demand was low, so it plans less stock, which makes the next stockout more likely.

Lea plans replenishment for an illustrative beauty brand that sells a vitamin C serum through its own shops. Demand runs at about 100 units a week, but the serum was out of stock for most of three of the last ten weeks, and those weeks recorded 40 units each. A ten-week average of raw sales gives (7 x 100 + 3 x 40) / 10 = 82 units a week, 18% below real demand. The next orders came in smaller, and the serum ran out again in week 12.

Researchers have measured the same effect at scale. The FreshRetailNet-50K dataset, published in 2025 with 50,000 hourly store-product series from 898 stores, annotates every stockout. Its authors report that forecasts trained on raw sales underestimated demand by 7.37%, and that reconstructing demand during stockouts first brought that bias close to zero while improving accuracy by 2.73%.

People make the same error. In a laboratory study published in Management Science in 2014, Rudi and Drake found that when decision-makers could only see censored sales, they set lower order quantities than when they could see full demand. Planners are not immune just because they know the theory.

The fix is to keep the lost sales from stockouts in your data, flagged, and use them when you build the forecast. In practice that means three things:

  1. Store a stockout flag for every product, location, and day (or hour) alongside sales.
  2. Replace sales in flagged periods with the estimated demand from the method above, or exclude those periods from model training.
  3. Re-run the forecast on the corrected history and compare it with the old one for the products with the most stockout days.

This is the same principle behind separating demand from sales when you improve forecast accuracy, and it is the first thing we check when a product keeps running out despite "accurate" forecasts. Across Metreecs' work with multi-store retailers, the products with the most stockout days are usually the ones whose forecasts are furthest below real demand, for exactly this reason. Tools for AI demand planning can automate the flagging and the reconstruction across every product and store, which is hard to sustain by hand beyond a few hundred combinations.

Where lost sales estimates go wrong

Some situations make any estimate of lost sales from stockouts much less reliable. Knowing where the method is weak tells you which numbers to trust in a report.

The planners we work with often underestimate how much of the total sits in partial stockouts (one missing size, an afternoon gap) rather than in long, visible ones. Starting with daily data is fine, and moving to hourly data for the top sellers usually changes the ranking.

Phantom stock

If the system says a product is in stock but the shelf is empty (wrong count, product in the stockroom, misplaced display), no stockout is recorded and the lost sales from stockouts on that product never get calculated. The FMI, GMA, and CIES study traced 25% of out-of-stocks to shelf management, which is exactly the kind of gap a stock record cannot see. Look for products with stock on hand and zero sales for several days in a row.

Promotions

If the stockout happened during a promotion, the baseline has to be promotional demand, not regular demand. Run-rate baselines taken from the weeks before a promotion understate the loss.

Slow and intermittent sellers

A product that sells two units a month has no meaningful daily run rate, and a five-day stockout may have cost nothing or one sale. For these items, use probabilities rather than averages, as in intermittent demand forecasting, and report a range.

New products

With no history, the baseline has to come from comparable products or stores, and the error is wider. Flag these estimates as low confidence.

Double counting

If you calculate lost sales for a product and also count the uplift on its substitute as "extra demand" elsewhere, you count the same shopper twice. Net substitution out once, at the level of the product that ran out.

FAQ

What is the formula for lost sales from a stockout?

Net lost units equal expected daily demand multiplied by the days out of stock, minus actual sales during that window, minus the uplift on substitute products in the same store. Multiply by unit margin to get the cost, and by price if you also need revenue.

Should I value lost sales from stockouts at price or at margin?

Use margin for decisions and price for reporting. A stockout saves the cost of the goods you did not sell, so the loss to the business is the margin, and substitutes give part of it back. Revenue is useful to show the scale of the problem, as long as everyone knows it overstates the cost.

How do I calculate lost sales for a product with no sales history?

Borrow a baseline from comparable products in the same store or from the same product in comparable stores, scaled to the store's usual share. Treat the result as an estimate with a wide range, and replace it with the product's own data once it has a few weeks of in-stock sales.

How do I calculate lost sales online?

Count sessions on the product page while it was out of stock, multiply by the page's normal conversion rate, and multiply again by the average units per order. Then subtract orders for substitute products placed by those same visitors, if your analytics can track them.

How do lost sales relate to safety stock?

Lost sales tell you what a stockout cost, and that cost is what safety stock is meant to prevent. Comparing the margin lost on a product with the cost of holding more of it helps you set safety stock where it pays for itself, rather than at one service level for the whole range.

Conclusion

To calculate lost sales from stockouts well, choose a baseline that reflects the week the product was missing, net out what substitutes recovered, value the rest at margin, and correct the sales history so the next forecast does not learn the stockout. Once you have that number for every product and store, rank stockouts by it and work on reducing stockouts cause by cause. To see lost sales and corrected demand on your own data, book a demo of Metreecs.

Sources

  • Food Marketing Institute, Grocery Manufacturers of America, and CIES, "Retail Out-of-Stocks: A Worldwide Examination of Extent, Causes and Consumer Responses" (2002), as summarized in the FMI press release of 14 October 2002: consumer responses (31% another store, 26% different brand, 9% no purchase), average loss of about 4% of sales, 47% of out-of-stocks from store ordering and forecasting and 25% from shelf management; 661 outlets, 32 categories, 71,000 consumers, 29 countries.
  • Wang et al. (2025), "FreshRetailNet-50K: A Stockout-Annotated Censored Demand Dataset for Latent Demand Recovery and Forecasting in Fresh Retail", arXiv 2505.16319: 50,000 store-product series from 898 stores; 2.73% accuracy gain and demand underestimation reduced from 7.37% to near zero after recovering latent demand.
  • Rudi and Drake (2014), "Observation Bias: The Impact of Demand Censoring on Newsvendor Level and Adjustment Behavior", Management Science 60(5): censored demand feedback leads to lower order quantities.
  • Every figure about the kitchenware chain, the garden centers, and the beauty brand is an illustrative calculation made for this article.

Our articles

Own your operations with AI Intelligence