The core equation
In a merchandising or manufacturing context, Cost of Goods Sold (COGS) is the cost of inventory that was actually sold during the period. Under a periodic calculation, you compute it with one central relationship:
Beginning Inventory + Net Purchases − Ending Inventory = COGSThis is a flow equation: you start with what you had on hand, add what you acquired (at the correct net cost), and subtract what remains. What is left must have been sold.
Step-by-step: how to compute COGS
- Step 1: Identify Beginning Inventory (BI). This is last period’s ending inventory amount carried into the new period.
- Step 2: Compute Net Purchases. Start with purchases and adjust for items that reduce or increase the cost of inventory acquired.
- Step 3: Compute Goods Available for Sale:
BI + Net Purchases. - Step 4: Subtract Ending Inventory (EI). The remainder is COGS.
Breaking down Net Purchases
Net Purchases represents the cost of inventory acquired and available to sell, measured at the amounts that should be capitalized into inventory (not overstated by returns or reduced by discounts you earned, and including necessary inbound shipping).
Net Purchases = Purchases − Purchase Returns & Allowances − Purchase Discounts + Freight-in| Component | What it means | Effect on Net Purchases | Typical impact on COGS (all else equal) |
|---|---|---|---|
| Purchases | Invoice cost of inventory bought for resale/production | Increases | Increases COGS (more goods available) |
| Purchase returns & allowances | Cost of goods returned to supplier or price reductions granted by supplier | Decreases | Decreases COGS (less cost remains) |
| Purchase discounts | Reductions for paying within discount terms (e.g., 2/10, n/30) | Decreases | Decreases COGS (inventory cost is lower) |
| Freight-in | Inbound shipping costs necessary to bring inventory to your location | Increases | Increases COGS (inventory cost is higher) |
How each component affects gross profit
Gross profit is:
Gross Profit = Net Sales − COGSBecause COGS is subtracted, anything that increases COGS will reduce gross profit (assuming sales stay the same), and anything that decreases COGS will increase gross profit.
Continue in our app.
You can listen to the audiobook with the screen off, receive a free certificate for this course, and also have access to 5,000 other free online courses.
Or continue reading below...Download the app
- Higher purchases (or higher freight-in) typically increase COGS, which reduces gross profit.
- More returns/allowances and more purchase discounts reduce net purchases, which typically reduces COGS and increases gross profit.
- Higher ending inventory reduces COGS (because more cost is “left on the shelf”), which increases gross profit.
- Lower ending inventory increases COGS, which reduces gross profit.
Worked example (structured, with numbers)
Assume the following for the year:
- Beginning Inventory (BI): $18,000
- Purchases: $120,000
- Purchase Returns & Allowances: $4,500
- Purchase Discounts: $2,000
- Freight-in: $3,200
- Ending Inventory (EI): $21,700
- Net Sales: $200,000
1) Compute Net Purchases
Net Purchases = Purchases − Returns/Allowances − Discounts + Freight-inNet Purchases = 120,000 − 4,500 − 2,000 + 3,200 = 116,7002) Compute Goods Available for Sale
Goods Available for Sale = BI + Net PurchasesGoods Available for Sale = 18,000 + 116,700 = 134,7003) Compute COGS
COGS = Goods Available for Sale − EICOGS = 134,700 − 21,700 = 113,0004) Compute Gross Profit (to see the impact)
Gross Profit = Net Sales − COGSGross Profit = 200,000 − 113,000 = 87,000Sensitivity check: how one component changes gross profit
Keep everything else the same and change only one item to see directionally what happens:
- If freight-in increases by $800, net purchases increase by $800, COGS increases by $800, and gross profit decreases by $800.
- If ending inventory is $2,000 higher than estimated, COGS would be $2,000 lower, and gross profit would be $2,000 higher.
Practice: solve for missing values
The same core formula can be rearranged to solve for any missing piece. Start from:
Beginning Inventory + Net Purchases − Ending Inventory = COGSRearrangements you will use often
- Ending Inventory:
Ending Inventory = Beginning Inventory + Net Purchases − COGS - Net Purchases:
Net Purchases = COGS + Ending Inventory − Beginning Inventory - Beginning Inventory:
Beginning Inventory = COGS + Ending Inventory − Net Purchases
Exercise A: compute Ending Inventory when COGS is known
Given:
- Beginning Inventory: $25,000
- Purchases: $90,000
- Purchase Returns & Allowances: $3,000
- Purchase Discounts: $1,500
- Freight-in: $2,500
- COGS: $84,000
Step 1: Net Purchases
Net Purchases = 90,000 − 3,000 − 1,500 + 2,500 = 88,000Step 2: Solve for Ending Inventory
Ending Inventory = Beginning Inventory + Net Purchases − COGSEnding Inventory = 25,000 + 88,000 − 84,000 = 29,000Exercise B: compute COGS with a missing Net Purchases component
Given:
- Beginning Inventory: $12,400
- Purchases: $64,000
- Purchase Returns & Allowances: $1,600
- Freight-in: $1,200
- Ending Inventory: $10,900
- Purchase Discounts: unknown
- COGS: $64,300
Find the purchase discounts.
Step 1: Use the main equation to find Net Purchases
Net Purchases = COGS + Ending Inventory − Beginning InventoryNet Purchases = 64,300 + 10,900 − 12,400 = 62,800Step 2: Plug into the Net Purchases breakdown and solve for discounts
Net Purchases = Purchases − Returns/Allowances − Discounts + Freight-in62,800 = 64,000 − 1,600 − Discounts + 1,20062,800 = 63,600 − DiscountsDiscounts = 800Why accurate Ending Inventory is critical (income statement and balance sheet)
Ending inventory is a pivot point because it appears in two places and drives two outcomes:
- Income statement effect (profit): Ending inventory is subtracted in the COGS computation. If ending inventory is overstated, COGS is understated and gross profit (and net income) is overstated. If ending inventory is understated, COGS is overstated and profit is understated.
- Balance sheet effect (assets): Ending inventory is reported as a current asset. Overstating it inflates total assets and equity; understating it deflates them.
Because the same ending inventory number affects both statements, an error can make profitability look better or worse while also misrepresenting financial position. That is why careful measurement and valuation of ending inventory is one of the most important controls in inventory accounting.