To calculate COGS, here’s the formula:
Cost of Goods Sold = Beginning Inventory + Inventory Purchases − Ending Inventory