Accounting
Basic

Cost of Goods Sold

The direct cost of the inventory actually sold during a period.

Formula

COGS=Opening Inventory+Purchases−Closing InventoryCOGS = Opening\ Inventory + Purchases - Closing\ Inventory

Variables

COGSCost of goods sold
OpeningInventory at start
PurchasesStock bought
ClosingInventory at end

Example

Open $20k + buy $50k − close $15k = $55k COGS

How it works

Cost of goods sold is the value of the inventory that was actually taken out of stock and sold during the period. You start with what you already had, add what you bought, then subtract what is still left at the end, because that closing stock was not sold. The result is the cost attached to the goods that left the business through sales.

When to use it

Use this formula when you need to find the direct cost of items sold in a trading or retail business over a month, quarter, or year. It is also useful when preparing profit calculations, since gross profit depends on COGS.

Worked example, step by step

Opening inventory = $12,000 Purchases = $38,000 Closing inventory = $9,000 COGS = Opening inventory + Purchases - Closing inventory COGS = 12,000 + 38,000 - 9,000 COGS = 41,000 Final answer: $41,000

Common mistakes to avoid

  • Subtracting purchases instead of adding them
  • Using sales revenue instead of closing inventory
  • Forgetting that closing inventory reduces COGS because it was not sold

Did You Know?

COGS excludes overheads like rent and admin — only costs tied directly to producing the goods sold.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026