software lab

How stockout cost is worked out

last updated: 2026-09-26

The formula behind revenue and margin lost to empty shelves, what the confidence labels mean, and why it is an upper estimate.

The Stockout cost report estimates the sales you missed while products were out of stock over the last 365 days. Shopify can't answer this: it keeps no history of stock levels. This app does.

The calculation

For each product that was out of stock at some point:

  1. Sales rate — units sold divided by the days it was in stock (with the same cap on exceptional days the forecast uses).
  2. Units lost — that rate × the days it was out of stock.
  3. Revenue lost — units lost × the price you actually got per unit over the year: net revenue divided by units sold, so discounts and refunds are already included. Not the list price.
  4. Margin lost — units lost × (that price − the unit cost). Only for products with a cost in Shopify; the rest show a dash.

Example: a product was in stock 300 days and sold 600 units, for $12,000 net. It was out of stock 65 days. Rate: 600 ÷ 300 = 2 per day → units lost: 2 × 65 = 130 → revenue lost: 130 × $20 = $2,600. With a cost of $8 per unit, margin lost: 130 × $12 = $1,560.

Read it as the high end

The estimate assumes customers would have kept buying at the same rate during the stockout. Some of them would have bought something else or gone elsewhere anyway, so the real loss is probably lower. It is an upper estimate, not an accounting figure — useful for seeing which products hurt most when they run out.

Confidence

Each row carries a label for how much of the number is measured and how much is extrapolated:

  • Measured — at least 28 days in stock, and it was out of stock no longer than it was in stock.
  • Estimated — fewer than 28 days in stock, or out of stock longer than in stock.
  • Rough — out of stock more than 3 times longer than it was in stock. Mostly extrapolation; take it as an indication.

Deduced under the label means most of the out-of-stock days were not recorded but deduced from long gaps in sales, because they happened before you installed the app. When that is true of every row, the report says it once under the summary instead.

Products not in the report

  • Products that never ran out: they lost nothing.
  • Products with fewer than 14 days in stock in the year: their rate is too uncertain, and multiplying it by a long stockout would produce the biggest — and least reliable — number on the screen.
  • Products with no net sales in the year.
  • Ignored products, untracked products and products sold on backorder.

The totals

  • Revenue lost — the sum, with how many of your tracked products contributed.
  • Margin lost — only over the products with a known cost, and it says how many. It is not comparable with the revenue total when some costs are missing. Add costs in Shopify (or from the product's page) to complete it.
  • Units lost — with the total days out of stock behind them.

What to do with it

Look at the top rows: products with high loss and Measured confidence are the ones where running out costs you most. Check their supplier's lead time is right and consider ordering earlier. See How a forecast is calculated.