The Cost of Goods Sold formula is:Beginning inventory + Purchases – Ending inventory = COGSFor example, if your Beginning Inventory was $15,000, your Purchases were $5,000 and your Ending Inventory was $7,000. Your Cost of Goods Sold = $13,000.