Sub topic 5
Inventory Days (DIO) from Cost of Goods Sold and Inventory
This chapter assumes you can read an income statement and a balance sheet, and that you know cost of goods sold (COGS) is an expense while inventory is an asset. You should also be comfortable with simple Python or spreadsheet formulas. Receivable days (DSO) from the previous chapter work the same way, so only the inputs change.
What DIO measures
Days inventory outstanding (DIO), also called inventory days, estimates how many days a company holds inventory before it is sold. A DIO of 60 means the inventory on the balance sheet equals about 60 days of cost of goods sold.
The formula is:
DIO = Inventory / COGS × Days in period
The numerator is a balance sheet number, a stock at one point in time. The denominator is an income statement number, a flow over a whole period. Multiplying by the days in the period converts the ratio into days.
Why COGS, not revenue
Inventory is recorded at cost, so it should be compared with a cost measure. Revenue includes the company's markup. Dividing inventory by revenue mixes a cost number with a price number, and the answer changes whenever margins change, even if the physical stock is unchanged.
Consider a company with inventory of 88.8, COGS of 540, and revenue of 900:
- Using COGS: 88.8 / 540 × 365 = 60.0 days.
- Using revenue: 88.8 / 900 × 365 = 36.0 days.
The revenue-based figure understates how long goods sit on the shelf, because the 900 includes 360 of gross profit that was never invested in inventory. It also moves with price changes. If the company raises prices 10% with no change in stock or unit costs, revenue-based days fall while the real holding period stays the same.
The same logic applies to payable days (DPO) in a later chapter. Both are cost-side measures and use COGS. Only receivables use revenue.
Choosing the balance: ending or average
The chapter on day-count conventions covered this choice. For DIO it works as follows.
- Ending balance: Use the year-end inventory. It is simple and matches how you will forecast, because a forecast produces an ending balance for each year.
- Average balance: Use (opening + ending) / 2. It is better when inventory changed sharply during the year, or when you want to compare turnover across companies on a like-for-like basis.
Using the same example with an opening inventory of 80:
- Ending basis: 88.8 / 540 × 365 = 60.0 days.
- Average basis: (80 + 88.8) / 2 = 84.4, so 84.4 / 540 × 365 = 57.0 days.
Neither is wrong. The rule is consistency. If you compute historical DIO on an average balance and then forecast inventory as COGS × DIO / 365, you get an average balance, not the ending balance the balance sheet needs. The result is inventory that is wrong by half of the year's change. Choose one basis, apply it to history, and use the inverse of the same formula in the forecast.
For a three-statement model the ending basis is usually the practical choice, since the forecast inventory line is itself the ending balance.
Worked example from history
Suppose three years of data:
| Year | COGS | Ending inventory | DIO (365, ending) |
|---|---|---|---|
| 1 | 480.0 | 76.0 | 57.8 |
| 2 | 510.0 | 82.0 | 58.7 |
| 3 | 540.0 | 88.8 | 60.0 |
Inventory grew from 76.0 to 88.8, about 17%. COGS grew 12.5%. Inventory grew faster than sales volume, so DIO drifted upward from 57.8 to 60.0. That pattern is a question to investigate, not just a number to extrapolate. It could mean a deliberate stock build ahead of a product launch, slower-moving products, or a supplier change that requires larger safety stock.
Computing DIO in code
The function below supports both balance bases and rejects inputs that would make the ratio meaningless.
def dio(cogs, ending_inventory, opening_inventory=None, days=365):
"""Days inventory outstanding.
If opening_inventory is given, the average balance is used;
otherwise the ending balance is used.
"""
if cogs <= 0:
raise ValueError("COGS must be positive to compute DIO")
if opening_inventory is None:
inventory = ending_inventory
else:
inventory = (opening_inventory + ending_inventory) / 2
return inventory / cogs * days
# Single-year example: ending versus average basis
print(f"Ending basis: {dio(540.0, 88.8):.1f}")
print(f"Average basis: {dio(540.0, 88.8, opening_inventory=80.0):.1f}")
# Three-year history on the ending basis
cogs_history = [480.0, 510.0, 540.0]
inventory_history = [76.0, 82.0, 88.8]
for year, (c, inv) in enumerate(zip(cogs_history, inventory_history), start=1):
print(f"Year {year}: DIO {dio(c, inv):.1f}")Running it prints:
Ending basis: 60.0
Average basis: 57.0
Year 1: DIO 57.8
Year 2: DIO 58.7
Year 3: DIO 60.0Running the formula in reverse
In a forecast you assume DIO and COGS, then solve for inventory:
Inventory = COGS × DIO / Days in period
If forecast COGS is 600 and DIO is 60, then inventory = 600 × 60 / 365 = 98.6. If COGS grows to 660 with DIO still at 60, inventory becomes 108.5. The increase of 9.9 is cash that stays in stock instead of reaching the bank. The inventory schedule chapter develops this fully, but the direction is worth fixing now: with constant DIO, growth in COGS raises inventory and consumes cash.
Interpreting the number
A DIO value has no meaning without context. Compare it in three ways.
- Against the company's own history. A rising trend means stock is building relative to sales. A falling trend means faster turnover or tighter control.
- Against peers in the same industry. A grocer may hold 20 days of inventory. A shipbuilder or a wine producer may hold hundreds. A "high" DIO is only high relative to the business model.
- Against the other two measures. DIO feeds the cash conversion cycle together with DSO and DPO. A long DIO may be offset by long supplier credit.
Lower is not automatically better. Very low DIO can signal stock-outs and lost sales. The target is the level that supports service without tying up unnecessary cash.
Edge cases that distort DIO
- Seasonality. A retailer's year-end balance sheet date may fall right after the holiday sell-through, so inventory looks unusually low. The same company measured in September would show a much higher DIO. If the business is seasonal, the year-end figure understates typical stock. Interim quarters or a multi-point average give a better picture.
- Rapid growth or decline. When COGS is rising quickly, year-end inventory is sized for next year's sales, but the denominator reflects the past year. DIO then looks inflated. The average-balance method reduces but does not remove this effect.
- Inventory valuation method. First-in-first-out (FIFO) and last-in-first-out (LIFO) change both the carrying value of inventory and COGS in periods of changing prices. Comparing a LIFO company with a FIFO company directly can mislead. Check the accounting policy note before comparing peers.
- Inventory composition. Raw materials, work in progress, and finished goods behave differently. A company that reports all three can be analyzed separately, but a single DIO blends them. A rise in finished goods is more worrying than a rise in raw materials ahead of a price increase.
- Write-downs. An inventory write-down lowers the balance and raises COGS in the same period. DIO falls, but not because the business turned faster. Look for unusual charges before reading improvement into a lower number.
- Companies with little or no inventory. Service businesses may report negligible inventory and small or zero COGS. The ratio is unstable or undefined, so a days schedule for inventory is not appropriate. The code above raises an error when COGS is not positive for this reason.
- Day count. Use the same basis for all three measures. With a 360-day basis, the example gives 88.8 / 540 × 360 = 59.2 days instead of 60.0. The difference is small, but mixing bases across DSO, DIO, and DPO makes the cash conversion cycle inconsistent.
Why this matters for cash
One day of DIO is worth COGS / 365 in inventory. At COGS of 540 that is about 1.5 per day. If DIO rises from 60 to 65, inventory rises by about 7.4, and that amount is a cash outflow in the year it happens. Conversely, trimming five days releases the same amount. This conversion from days to currency is the basis for the sensitivity analysis in a later chapter, and it is why small-looking changes in a days assumption can matter against a modest cash balance.
Exercise
A company reports annual COGS of 720, revenue of 1,100, and year-end inventory of 120. Compute DIO on an ending-balance, 365-day basis. Then say what happens to the answer if you mistakenly use revenue in the denominator, and why that is the wrong choice.
Show answer
DIO = 120 / 720 × 365 = 60.8 days. Using revenue gives 120 / 1,100 × 365 = 39.8 days. That figure is wrong because inventory is carried at cost, while revenue includes gross margin. The result would also shift whenever prices or margins changed, even if the physical holding period did not.
Exercise
Forecast COGS for next year is 800 and you assume DIO of 55 days on a 365-day, ending-balance basis. What forecast inventory balance results? If last year's inventory was 110, what is the cash effect of the inventory change alone?
Show answer
Inventory = 800 × 55 / 365 = 120.5. The increase is 120.5 − 110 = 10.5, so inventory uses 10.5 of cash (a cash effect of −10.5).
Exercise
Opening inventory is 80, ending inventory is 88.8, and COGS is 540. Why can the average-balance DIO of 57.0 not be used directly to forecast next year's ending inventory as COGS × DIO / 365?
Show answer
Because that formula returns the average balance for the year, not the ending balance. The balance sheet needs the ending balance, so you would understate inventory when it is growing. Either forecast on an ending-balance basis throughout, or solve for the ending balance from the target average and the opening balance.