The COGS formula
For a business that carries inventory, cost of goods sold over a period is:
COGS = Beginning inventory + Purchases − Ending inventory
The logic: take everything you started with, add what you bought, then subtract what’s still on the shelf. What’s left is the cost of what actually left the door. If you don’t track inventory — many makers and service sellers don’t — your COGS is simply the direct cost of the units sold: materials plus the direct labour to produce them.