CalculatorMasters

Monthly Cost of Goods Sold Formula

Learn how monthly cost of goods sold, gross profit, and gross margin are calculated from inventory and sales figures.

The monthly cost of goods sold formula estimates the direct inventory cost assigned to products sold during a month. It starts with inventory available for sale, then removes the inventory that remains on hand at month-end; this result can then be compared with net sales to estimate gross profit and gross margin.

  • 100% Free
  • No Sign-Up Required
  • Private & Secure
  • Mobile Friendly

Monthly Cost of Goods Sold

COGS = Opening Inventory + (Purchases − Purchase Returns) + Freight-In − Closing Inventory

Where:

Start with beginning inventory, add purchases after supplier returns and direct buying costs, then subtract the inventory still unsold at the end of the month.

Variables Explained

VariableWhat It MeansUnit
openingInventory - Opening inventoryThe recorded inventory value at the start of the month.currency
purchases - Inventory purchasesThe cost of inventory purchased during the month before returns and allowances.currency
purchaseReturns - Purchase returns and allowancesAmounts that reduce the cost of purchases, such as inventory returned to suppliers.currency
freightIn - Freight-in and direct buying costsDirect costs of acquiring inventory, such as inbound shipping, handling, or duty where applicable.currency
closingInventory - Closing inventoryThe recorded value of inventory still on hand at the end of the month.currency
salesRevenue - Monthly sales revenueNet sales revenue used to calculate gross profit and gross margin.currency

Step-by-Step Calculation

1

Calculate net purchases

Subtract supplier returns and purchase allowances from gross inventory purchases.

netPurchases = purchases - purchaseReturns

2

Find goods available for sale

Combine beginning inventory, net purchases, and direct inventory acquisition costs.

goodsAvailableForSale = openingInventory + netPurchases + freightIn

3

Calculate cost of goods sold

Subtract inventory still on hand because it was not sold during the month.

costOfGoodsSold = goodsAvailableForSale - closingInventory

4

Calculate gross profit

Deduct the calculated cost of goods sold from monthly net sales revenue.

grossProfit = salesRevenue - costOfGoodsSold

5

Calculate gross margin

Express gross profit as a percentage of sales revenue.

grossMargin = (grossProfit / salesRevenue) * 100

Monthly inventory retailer example

Opening inventory$10,000
Inventory purchases$25,000
Purchase returns and allowances$1,000
Freight-in and direct buying costs$500
Closing inventory$12,000
Monthly sales revenue$40,000
1

Net purchases

$25,000 − $1,000

$24,000

2

Goods available for sale

$10,000 + $24,000 + $500

$34,500

3

Cost of goods sold

$34,500 − $12,000

$22,500

4

Gross profit

$40,000 − $22,500

$17,500

5

Gross margin

($17,500 ÷ $40,000) × 100

43.8%

Final Result

Estimated monthly COGS is $22,500. Gross profit is $17,500 and gross margin is 43.8%.

Try the Calculator →

Assumptions

  • All figures relate to the same monthly accounting period.
  • Opening and closing inventory are measured using a consistent inventory valuation method.
  • Purchase returns and allowances relate to purchases made for resale or production.
  • Freight-in and direct buying costs are included only when they are treated as inventory costs.
  • Sales revenue is entered net of sales returns, discounts, and allowances when calculating gross margin.

Limitations

  • !The calculation does not include operating expenses such as rent, marketing, administration, or many payroll costs.
  • !An incorrect physical count or inventory valuation can materially change the result.
  • !The treatment of freight, duties, overhead, write-downs, and production costs can vary by accounting framework and business circumstances.
  • !The formula is most appropriate for inventory-based businesses, not businesses that primarily sell services.
  • !Results are estimates and are not financial, tax, or professional accounting advice.

Common Mistakes to Avoid

1

Using sales revenue instead of inventory purchases in the COGS calculation.

2

Forgetting to subtract purchase returns and supplier allowances.

3

Adding outbound customer delivery costs as freight-in when they are not acquisition costs.

4

Leaving out closing inventory, which can overstate COGS.

5

Mixing values from different months or using gross sales instead of net sales for the margin calculation.

6

Changing inventory valuation methods between opening and closing balances without adjusting the figures consistently.

Related Formulas

Frequently Asked Questions

What is the monthly cost of goods sold formula?

Monthly COGS equals opening inventory plus purchases minus purchase returns, plus freight-in and direct buying costs, minus closing inventory.

Why is closing inventory subtracted from COGS?

Closing inventory represents goods still on hand at month-end. Because those goods were not sold during the month, their cost is excluded from COGS.

How do purchase returns affect COGS?

Purchase returns and allowances reduce net purchases. Lower net purchases generally reduce goods available for sale and COGS, all else being equal.

Is freight-in included in the COGS formula?

Freight-in and other direct costs required to acquire inventory may be included in inventory cost. The appropriate treatment can depend on the business and accounting approach.

How is gross margin calculated from COGS?

First calculate gross profit as sales revenue minus COGS. Then divide gross profit by sales revenue and multiply by 100.

Can COGS be negative?

A negative result can occur mathematically if closing inventory exceeds goods available for sale, but it often indicates missing, inconsistent, or incorrectly valued inventory data.

Ready to calculate your result?

Use the calculator to get instant results with your own inputs.

Try Monthly Cost of Goods Sold