Average cost and cost of goods sold, explained simply
Learn how weighted average cost works with a three-purchase example, how one sale is costed, and how cost of goods sold for a month is worked out.
In this article
You bought the same charger three times this month, at three different prices. Today you sold five of them. What did those five cost you? If you guess with the latest price, your profit is wrong. If you guess with the oldest price, it is wrong the other way. Weighted average cost gives you one fair answer, and it is easy to work out.
Two terms in plain words
- Average cost is what one unit on your shelf has cost you, on average, across all the stock you still hold.
- Cost of goods sold (often written COGS) is what the items you actually sold cost you. Not what you bought this month: what you sold.
The difference matters. If you buy ₹1,00,000 of stock in October and sell only half of it, your October cost is about ₹50,000. The other half is still on the shelf. It is not a cost yet. Treating every purchase as a cost makes a restocking month look like a loss and a quiet month look like a great one.
A worked example with three purchases
Say you sell a phone charger. All prices here are before GST. You start the month with none in stock.
| Date | What happened | Units on hand | Value of stock | Average cost |
|---|---|---|---|---|
| 1 Oct | Buy 20 at ₹150 (₹3,000) | 20 | ₹3,000 | ₹150.00 |
| 10 Oct | Buy 30 at ₹160 (₹4,800) | 50 | ₹7,800 | ₹156.00 |
| 18 Oct | Sell 30, costed at ₹156 (₹4,680) | 20 | ₹3,120 | ₹156.00 |
| 25 Oct | Buy 60 at ₹170 (₹10,200) | 80 | ₹13,320 | ₹166.50 |
| 28 Oct | Sell 5, costed at ₹166.50 (₹832.50) | 75 | ₹12,487.50 | ₹166.50 |
The rule is the same at every purchase: add the new purchase to the value of what you already hold, then divide by the new number of units. On 25 October that is ₹3,120 + ₹10,200 = ₹13,320, divided by 20 + 60 = 80 units, which gives ₹166.50.
A sale does not change the average. It takes units out at the current average, so the value and the count fall together. On 18 October, 30 units left at ₹156 each, and the 20 that remained were still worth ₹156 each.
Costing one sale
Look at the sale on 28 October. You sold 5 chargers at ₹249 each.
| Line | Amount |
|---|---|
| Sale value (5 × ₹249) | ₹1,245.00 |
| Cost of goods sold (5 × ₹166.50) | ₹832.50 |
| Gross profit | ₹412.50 |
| Gross margin (₹412.50 ÷ ₹1,245) | 33.1% |
Compare the guesses. Costed at the latest price of ₹170, the same sale shows a profit of ₹395. Costed at the oldest price of ₹150, it shows ₹495. Neither is the truth about the stock you hold. The average is the honest middle, and it does not jump about every time a supplier changes the price.
Cost of goods sold for a whole month
If you do not cost each sale, you can still work out the month's cost of goods sold from three figures:
Opening stock + Purchases − Closing stock = Cost of goods sold
Say you start the month with stock worth ₹40,000, buy ₹1,20,000 during the month, and count stock worth ₹50,000 at the end. Your cost of goods sold is ₹40,000 + ₹1,20,000 − ₹50,000 = ₹1,10,000. This method needs an accurate stock count at both ends of the month. Any theft, damage or counting mistake hides inside the figure, which is why costing each sale as it happens is better when you can manage it.
Mistakes that spoil the figure
- No opening cost. If you start with stock but enter no cost for it, the first sales look like pure profit.
- Purchases not entered. The average is only as good as the bills behind it. See why purchase bills matter.
- Counting stock purchases as expenses. Stock becomes a cost only when it sells.
- Mixing in GST. Keep cost and sale figures before GST, so the tax does not inflate both sides.
How InvoiceKaro handles this
InvoiceKaro uses weighted average cost. Each purchase bill for a catalogue item updates that item's average, and the opening stock cost you enter becomes the starting average. When an invoice is issued or a quick bill is saved, the current average cost is saved against that sale, and later purchases do not change it. The profit report then shows revenue, cost of goods sold and gross profit for the period, and Margin by item shows the margin on each item. Cost prices, average cost and profit figures are visible to the owner only. See Expenses & profit.