
Annual Cost of Goods Sold Formula
Learn how annual cost of goods sold, gross profit, and gross margin are calculated from inventory, purchases, direct costs, and revenue.
Annual cost of goods sold (COGS) estimates the direct cost assigned to inventory sold during an accounting year. Calculating it helps separate the cost of generating sales from gross profit before indirect operating expenses, finance costs, and taxes.
- 100% Free
- No Sign-Up Required
- Private & Secure
- Mobile Friendly
Annual Cost of Goods Sold
Where:
Start with inventory on hand at the beginning of the year, add purchases and direct costs, then subtract inventory still on hand at year end. The remainder is the estimated cost of goods sold.
Variables Explained
| Variable | What It Means | Unit |
|---|---|---|
| openingInventory - Opening inventory | The carrying value of inventory available at the beginning of the accounting year. | currency |
| inventoryPurchases - Inventory purchases | The cost of goods bought for resale or materials bought for production during the year. | currency |
| directCosts - Other direct costs | Costs directly related to acquiring or producing inventory, such as direct labour or freight-in where applicable. | currency |
| closingInventory - Closing inventory | The carrying value of unsold inventory remaining at the end of the accounting year. | currency |
| annualRevenue - Annual sales revenue | Total sales revenue for the year before deducting COGS. | currency |
| annualCogs - Annual cost of goods sold | The estimated direct cost of the inventory sold during the year. | currency |
| grossProfit - Gross profit | Sales revenue remaining after annual COGS is deducted. | currency |
| grossMargin - Gross margin | Gross profit expressed as a percentage of annual sales revenue. | percent |
Step-by-Step Calculation
Calculate goods available for sale
Add beginning inventory to purchases and other qualifying direct costs incurred during the year.
goodsAvailableForSale = openingInventory + inventoryPurchases + directCosts
Calculate annual cost of goods sold
Subtract closing inventory because it remains unsold at year end and is not assigned to this year's sales.
annualCogs = goodsAvailableForSale - closingInventory
Calculate gross profit
Deduct the estimated cost of goods sold from annual sales revenue.
grossProfit = annualRevenue - annualCogs
Calculate gross margin
Divide gross profit by revenue and multiply by 100. This result requires annual revenue to be greater than zero.
grossMargin = grossProfit / annualRevenue * 100
Worked example: annual COGS for a retailer
Add opening inventory and purchases
$80,000 + $240,000
$320,000
Calculate goods available for sale
$320,000 + $30,000
$350,000
Calculate annual COGS
$350,000 - $70,000
$280,000
Calculate gross profit
$500,000 - $280,000
$220,000
Calculate gross margin
$220,000 / $500,000 × 100
44.0%
Final Result
Estimated annual COGS is $280,000, gross profit is $220,000, and gross margin is 44.0%.
Assumptions
- ✓All figures relate to the same accounting year and are stated in the same currency.
- ✓Opening and closing inventory are measured using a consistent inventory valuation method.
- ✓Purchases and direct costs entered relate to goods acquired, produced, or sold in the period.
- ✓Closing inventory represents inventory still on hand at the reporting date.
- ✓Revenue is recorded for the same period as the calculated COGS.
Limitations
- !Inventory write-downs, shrinkage, damaged stock, returns, rebates, and adjustments can change reported COGS.
- !Which costs qualify as direct costs can depend on the business, accounting policy, and applicable reporting framework.
- !The calculation does not separately account for work in progress, manufacturing overhead allocation, or complex production costing.
- !A gross margin calculation is not meaningful when annual revenue is zero.
- !The results are estimates and are not financial, tax, or professional advice.
Common Mistakes to Avoid
Entering sales revenue instead of the cost paid for inventory purchases.
Including unsold closing inventory in COGS by forgetting to subtract it.
Using inventory balances from different dates or accounting periods.
Including general office, marketing, or administrative costs as direct inventory costs without considering the accounting treatment.
Mixing tax-inclusive and tax-exclusive figures within the same calculation.
Using a closing inventory value calculated under a different valuation method than opening inventory.
Related Formulas
Frequently Asked Questions
What is the annual cost of goods sold formula?
Annual COGS is commonly calculated as opening inventory plus inventory purchases plus other direct costs, less closing inventory.
How do you calculate goods available for sale?
Add opening inventory, inventory purchases, and qualifying direct costs. This is the total cost available to be assigned either to sales or to closing inventory.
Why is closing inventory deducted from COGS?
Closing inventory remains unsold at year end. Its cost is carried forward rather than treated as the cost of this year's sales.
How is gross profit calculated from COGS?
Gross profit equals annual sales revenue minus annual cost of goods sold.
How is gross margin calculated?
Gross margin equals gross profit divided by annual revenue, multiplied by 100. If revenue is $500,000 and gross profit is $220,000, gross margin is 44.0%.
Are direct labour costs included in COGS?
Direct labour used to make goods may be included where it is directly attributable to production. The treatment of individual costs can vary by business and accounting policy.
Ready to calculate your result?
Use the calculator to get instant results with your own inputs.