
Work through opening inventory, net purchases and closing stock to calculate COGS, gross profit and margin without double-counting purchases.
Example basis: All figures, probabilities, business volumes and results are original fictional planning assumptions, not market benchmarks, observed vendor results or income promises. Reviewed November 18, 2026.
The cost of goods sold formula
For a simple resale model, cost of goods sold equals opening inventory + net inventory purchases + applicable acquisition costs − closing inventory. Use inventory cost rather than selling price. The formula measures the cost assigned to goods sold during the period, not every payment made to suppliers.
Manufacturing, services, inventory methods and tax rules can require different cost boundaries. This article uses one fictional reseller and a simplified periodic inventory example in USD. The IRS resource is a US Schedule C reference, not a universal bookkeeping policy or evidence your business must use this exact method.
Gather four records before calculating
Take the opening stock value from the reviewed closing inventory of the previous period. Reconcile purchase invoices, returns and discounts for the current period. Identify freight or other acquisition costs included under the chosen policy. Finish with a dated physical count, adjusted for ownership, condition and cutoff.
Do not value ending stock at retail ticket price. Inspect goods in transit, consigned stock and customer-owned items separately so ownership is not assumed merely because goods are physically on a shelf. Record the method and ask your accountant how returns, write-downs and freight should be treated.
Original fictional reseller example
| Inventory component | Example amount | How it is used |
|---|---|---|
| Opening inventory | $4,000 | Cost carried into the month |
| Purchases before returns | $7,200 | Supplier invoices in the period |
| Purchase returns | $200 | Deducted from purchases |
| Net purchases | $7,000 | 7,200 − 200 |
| Included inbound freight | $300 | Included once under the stated policy |
| Goods available at cost | $11,300 | 4,000 + 7,000 + 300 |
| Closing inventory | $3,100 | Supported ending cost value |
| COGS | $8,200 | 11,300 − 3,100 |
Assume earned net sales are $13,000. Gross profit is $13,000 − $8,200 = $4,800. Gross margin is $4,800 ÷ $13,000 × 100 = 36.92%, rounded to two decimals. This is not net profit: rent, administration, interest, tax and other expenses remain outside that gross-profit calculation.
If sales are zero, do not display a made-up margin percentage. Report the gross-profit amount and explain that the percentage denominator is zero. If your closing stock exceeds goods available under the entered model, investigate missing purchases, cutoff or valuation before accepting a negative cost result.
Purchases, cash paid and consumption differ
Suppose the $7,300 of net purchases and freight includes $1,500 still unpaid at the end of the month. Current-period cash paid for those purchases is $5,800, assuming none was prepaid and no other payments are included. That is not the $8,200 COGS.
COGS also releases cost from opening inventory. Accounts payable explain unpaid purchases; receivables explain unpaid sales. A cash-flow statement follows actual payments, while the income statement uses the reconciled period COGS figure you enter. Neither automatically counts or values inventory.
Show the effect of a stock-count error
In a disposable copy, incorrectly enter closing stock as $3,600 instead of $3,100. COGS falls by $500 to $7,700, and gross profit rises by $500 to $5,300. The higher margin is an error in this scenario, not improved trading.
Restore the verified count. Keep count sheets, cost evidence and approved adjustments with reviewer and date. If shrinkage, damaged goods or valuation issues are present, use their actual evidence and correct treatment instead of silently changing the stock value to reach a target profit.
Keep owner-use inventory and returns visible
Track goods taken for personal use separately from genuine business sales and expenses. The applicable accounting and tax treatment depends on the facts. For US Schedule C, Publication 334 discusses excluding merchandise withdrawn for personal or family use from the relevant purchase cost; confirm current instructions and your records before filing.
A supplier return reduces the applicable purchase amount; a customer return has its own sales and inventory effects. Do not subtract a purchase return twice through both net purchases and a second adjustment line. Retain a clear reference to the credit document and period.
Use COGS in a practical stock decision
Compare gross margin over matched periods only after the count, valuation and product mix are reviewed. A falling margin can come from price changes, purchase costs, sales mix, discounts or inventory errors; the total does not identify the cause.
Link the review to the retail business plan and sales and inventory workflow. Restocking decisions also need demand, lead time, shelf life and available cash, not only a gross-margin percentage.
Common questions
Is freight always included? No universal treatment is asserted here. This example explicitly includes $300 inbound freight once; actual policies and tax rules need review.
Can a service business use this exact inventory formula? It may have direct service costs with a different structure. Define the service cost boundary before using a merchandise model.
Does the tool calculate tax COGS? No. The income worksheet accepts your reviewed COGS as one input; it does not select an inventory method or prepare a tax return.
Sources and method
References explain the definitions and reporting boundaries used here. Worked figures and decision examples are original.