Skip to main content

COGS Calculator: Cost of Goods Sold Formula

Work out cost of goods sold from your inventory counts and purchases, then see the gross profit and margin it leaves.

Work out cost of goods sold

Enter inventory at cost at the start and end of the period, what you bought during it, and your sales for the same period.

Cost of goods sold for the period

$91,000

Of $136,000 of stock available to sell, $45,000 is still on hand, so $91,000 counts as cost of goods sold. Against $180,000 of sales, that leaves a 49.4% gross margin.

Goods available for sale
$136,000
Gross profit
$89,000
Gross margin
49.4%

Count the full cost of what you sold.

What the result shows

The cost of goods sold for the period, the goods available to sell, and the gross profit and gross margin against your sales.

How it is calculated

Add purchases and inbound freight and duty to beginning inventory for goods available to sell. Subtract ending inventory for cost of goods sold, then subtract that from sales for gross profit.

How to use it

Include freight and duty in the cost of stock, or gross margin will look higher than it is. Compare gross margin across periods to spot rising supplier or freight costs early.

Worked example

A store starts the quarter with $50,000 of inventory at cost, buys $80,000 of stock and pays $6,000 for inbound freight and duty. That makes $136,000 of goods available to sell. Stock worth $45,000 is still on hand at the end, so cost of goods sold is $91,000. Against $180,000 of sales, gross profit is $89,000, a 49.4% gross margin.

What this result leaves out

Inventory counts and purchases are entered as totals at cost. Write-offs, shrinkage, stock in transit, and the costing method used (such as FIFO or average cost) are not modelled.

Before you use the result

What is the COGS formula?

Cost of goods sold is beginning inventory plus purchases and the freight and duty paid to bring stock in, minus ending inventory. In the example, $50,000 plus $80,000 plus $6,000, minus $45,000, gives $91,000.

What costs are included in COGS for an online store?

The supplier price of the products you sold, plus inbound freight, duty and customs fees paid to bring that stock in. Shipping to customers, payment fees, ads and salaries are operating costs, not cost of goods sold.

Why does ending inventory reduce COGS?

Stock still on hand has not been sold, so its cost stays on the balance sheet as inventory. Only the cost of goods that left the business in the period counts as an expense.

How does COGS affect gross margin?

Gross profit is sales minus cost of goods sold, and gross margin is gross profit divided by sales. $180,000 of sales with $91,000 of cost of goods sold leaves $89,000 of gross profit, a 49.4% margin. Leaving freight or duty out of cost of goods sold makes the margin look higher than it is.

Stop rebuilding the same calculation every week.

Nummbas brings sales, costs, products, ads, and cash flow into one view so the numbers change when the business does.