COGS Calculator (Cost of Goods Sold)
Calculate cost of goods sold from opening inventory, purchases, and closing inventory, and derive gross profit and margin from it.
Formula & Reference
| Variable | Symbol | Formula | Units |
|---|---|---|---|
| COGS Calculator (Cost of Goods Sold) | — | COGS = opening inventory + purchases − closing inventory | currency |
Step-by-Step Examples
Opening 180,000, purchases 940,000, freight 22,000, closing 210,000, revenue 1,650,000.
- Goods available = 180,000 + 940,000 + 22,000 = 1,142,000
- COGS = 1,142,000 − 210,000 = 932,000
- Gross profit = 1,650,000 − 932,000 = 718,000
- Gross margin = 43.52%
Opening 100,000, purchases 500,000, closing 180,000, revenue 700,000.
- Goods available = 600,000
- COGS = 600,000 − 180,000 = 420,000
- Inventory grew 80,000, so COGS is lower than purchases
- Gross margin = 40.00%
Opening 250,000, purchases 400,000, closing 120,000, revenue 750,000.
- Goods available = 650,000
- COGS = 650,000 − 120,000 = 530,000
- COGS exceeds purchases because stock was drawn down
- Gross margin = 29.33%
Real-World Applications
Common Mistakes to Avoid
Marketing, administrative salaries, and general overhead belong in operating expenses, not COGS. Including them understates gross margin and misleads on unit economics.
Inbound freight is part of the cost of acquiring inventory and belongs in COGS. Outbound shipping to customers is a selling expense.
They are only equal when inventory is unchanged. Building stock makes COGS lower than purchases; drawing it down makes COGS higher.