What Is the Formula for Calculating Days Inventory Outstanding?
The days inventory outstanding formula is:
Average Inventory/Cost of Goods Sold x Number of Days = Days Inventory Outstanding

To begin calculating DIO, you’ll first need to calculate the average value of your inventory for a specific period of time.
For example, if you’re calculating DIO at the end of the year, you’ll take your beginning inventory total, and your ending inventory total, and divide that by 2 to get your average inventory.
This is the formula to calculate your average inventory for the period:
(Opening Inventory + Closing Inventory) / 2 = Average Inventory

You can also calculate DIO quarterly if you prefer. Let’s say your inventory total as of January 1, 2023, is $115,000 and your ending inventory total for March 31 is $145,000, the total inventory would be $260,000.
This number is then divided by two, making your average inventory for the first quarter $130,000.
Next, you’ll obtain your cost of sales or cost of goods sold (COGS)from your income statement for the same period. If you’re calculating the cost of goods sold manually, you would use the following formula:
Opening Inventory + Purchases – Closing Inventory = Cost of Goods Sold

For this example, we’ll say that the COGS total for the first quarter is $495,000.
Finally, you’ll need to calculate the number of days in which you’re calculating DIO. For the first quarter, the number of days would be 90. If you were calculating DIO for the year, the total number of days would be 365.
Now that you have all of the necessary totals, you’re ready to calculate the DIO.
$130,000 / $495,000 x 90 = 23.63 days
The result shows that for the first quarter of 2023, your business is able to clear existing inventory every twenty-four days. For planning purposes, the result means that you’ll likely sell out and restock inventory monthly.