To calculate the days of inventory outstanding, divide the average inventory value by the average daily cost of goods sold (COGS). First, determine the average daily COGS by dividing the total COGS for a specific period by the number of days in that period. Next, calculate the average inventory value by adding the beginning and ending inventory values for the same period and dividing the total by 2. Finally, divide the average inventory value by the average daily COGS to obtain the days of inventory outstanding. This metric helps measure the efficiency of inventory management and indicates how long, on average, it takes for a company to sell its inventory.