Sub topic 7
Weighted average: one blended unit cost
This chapter assumes you know debits and credits, the income statement and balance sheet, and what inventory and cost of goods sold (COGS) mean. It also assumes you have seen the COGS equation: beginning inventory plus purchases equals goods available for sale, and goods available for sale minus ending inventory equals COGS. If you have worked through FIFO and LIFO, you already have the comparison figures used here.
The idea
FIFO and LIFO treat purchases as separate cost layers and decide which layer leaves first. Weighted average cost drops the layers. It blends all the costs into one unit cost and uses that cost for both units sold and units still on hand.
The formula is:
weighted average unit cost = cost of goods available for sale / units available for saleEvery unit sold carries that blended cost, and so does every unit left over. The method fits goods that are interchangeable and hard to tell apart, such as fuel, grain, chemicals, or screws in a bin. In those cases no one can say which purchase a given unit came from, and a blended cost reflects that.
Periodic weighted average
Under the periodic system you count inventory and compute COGS once, at the end of the period. The weighted average is then a single division.
Use the running example. The company had these layers:
| Layer | Units | Unit cost | Total cost |
|---|---|---|---|
| Beginning inventory | 100 | $10 | $1,000 |
| Purchase 1 | 200 | $12 | $2,400 |
| Purchase 2 | 100 | $14 | $1,400 |
| Goods available | 400 | $4,800 |
The average cost is $4,800 / 400 = $12.00 per unit. The company sold 250 units, so:
- COGS = 250 × $12.00 = $3,000
- Ending inventory = 150 × $12.00 = $1,800
- Check: $3,000 + $1,800 = $4,800, the goods available for sale
Compare this with the other methods on the same data. FIFO gives COGS of $2,800 and ending inventory of $2,000. LIFO gives COGS of $3,200 and ending inventory of $1,600. The weighted average result sits between them. This is not a coincidence. A blended cost always lies between the lowest and highest layer costs, so the average method smooths the effect of price changes.
Perpetual weighted average (moving average)
Under the perpetual system you record inventory after every purchase and sale. The weighted average then becomes a moving average. You recompute the average cost after each purchase, and each sale is costed at the average in effect on the sale date.
Sales do not change the average. When you remove units at the current average cost, the remaining units still carry that same average. Only purchases at a different price move it.
Here is the example with dated events. The company starts with 100 units at $10 and then has these events:
| Day | Event | Units on hand | Inventory cost | Average cost | COGS recorded |
|---|---|---|---|---|---|
| Start | Opening balance | 100 | $1,000.00 | $10.0000 | |
| 5 | Buy 200 at $12 | 300 | $3,400.00 | $11.3333 | |
| 10 | Sell 150 | 150 | $1,700.00 | $11.3333 | $1,700.00 |
| 15 | Buy 100 at $14 | 250 | $3,100.00 | $12.4000 | |
| 20 | Sell 100 | 150 | $1,860.00 | $12.4000 | $1,240.00 |
Total COGS is $1,700 + $1,240 = $2,940, and ending inventory is $1,860. Check: $2,940 + $1,860 = $4,800.
The result differs from the periodic figure of $3,000 for the same purchases and the same 250 units sold. The reason is timing. The periodic method uses one average that includes the day-15 purchase at $14, even for the day-10 sale, which happened before that purchase. The moving average only includes costs that had been incurred by the day of each sale. When prices are rising, that makes perpetual COGS lower than periodic COGS.
Running both calculations in code
The program below computes the periodic average and then steps through the perpetual events, printing the state after each one.
# Periodic weighted average
layers = [(100, 10), (200, 12), (100, 14)] # (units, unit_cost)
units_sold = 250
total_units = sum(u for u, _ in layers)
goods_available = sum(u * c for u, c in layers)
avg = goods_available / total_units
periodic_cogs = avg * units_sold
print("Periodic avg", f"{avg:.2f}")
print("Periodic COGS", f"{periodic_cogs:.2f}",
"Ending inventory", f"{goods_available - periodic_cogs:.2f}")
# Perpetual moving average
units, total_cost = 100, 1000.0
cogs = 0.0
events = [
("buy", 200, 12),
("sell", 150, None),
("buy", 100, 14),
("sell", 100, None),
]
for kind, qty, unit_cost in events:
if kind == "buy":
units += qty
total_cost += qty * unit_cost
else:
current_avg = total_cost / units
out = qty * current_avg
cogs += out
units -= qty
total_cost -= out
print(kind, qty, units, f"{total_cost:.2f}", f"{total_cost / units:.4f}")
print("Perpetual COGS", f"{cogs:.2f}",
"ending units", units, "ending cost", f"{total_cost:.2f}")The output is:
Periodic avg 12.00
Periodic COGS 3000.00 Ending inventory 1800.00
buy 200 300 3400.00 11.3333
sell 150 150 1700.00 11.3333
buy 100 250 3100.00 12.4000
sell 100 150 1860.00 12.4000
Perpetual COGS 2940.00 ending units 150 ending cost 1860.00Notice that the sale branch reduces total_cost by the cost it moved out, rather than multiplying the remaining units by a rounded average. That keeps the balance exact.
Journal entries
Under the perpetual system, a purchase debits Inventory and credits Accounts Payable or Cash. Each sale needs two entries. The first records the revenue. The second moves cost out of inventory: debit Cost of Goods Sold and credit Inventory, at the moving average on that date. For the day-10 sale in the example, the second entry is a debit to COGS for $1,700 and a credit to Inventory for $1,700.
Under the periodic system, purchases go to a Purchases account during the period. At period end you compute COGS from the equation, then adjust the Inventory account to the ending balance of $1,800.
Rounding and precision
The average is rarely a round number. $3,400 / 300 is $11.3333..., and you must decide how to handle it. There are two common approaches.
- Carry the average at full precision and round only the dollar amounts you post. Round the cost removed on each sale to cents.
- Round the unit cost to a fixed number of decimals, such as four, and accept small differences.
Either way, make the ending inventory the balancing figure. Compute it as the total cost on hand minus the cost removed, rather than recomputing units × rounded average. Otherwise a few cents of rounding error build up in the inventory account and no longer match the subledger.
Common errors
- Averaging the unit prices instead of weighting them. The simple average of $10, $12, and $14 is $12, which happens to match here only because the layer sizes differ symmetrically. Change the quantities and the two diverge. Always divide total cost by total units.
- Using the periodic average for perpetual sales. A sale on day 10 cannot use a cost from a purchase on day 15.
- Recomputing the average after a sale. Sales remove cost and units in the same proportion, so the average is unchanged. Recalculating only matters if you round.
- Forgetting beginning inventory. The opening units and cost are part of the pool.
- Mixing returns in carelessly. A purchase return should come out at the original purchase price, which then changes the pool and the average. A sales return comes back at the average cost used for the original sale.
Effects when prices move
The average method moves with prices, but slowly, because old and new costs are blended.
| Price trend | COGS relative to FIFO and LIFO | Ending inventory relative to FIFO and LIFO | Reported profit |
|---|---|---|---|
| Rising | Between FIFO (lowest) and LIFO (highest) | Between LIFO (lowest) and FIFO (highest) | Between the two |
| Falling | Between LIFO (lowest) and FIFO (highest) | Between FIFO (lowest) and LIFO (highest) | Between the two |
Suppose the 250 units sold for $20 each, so revenue is $5,000. Gross profit is $5,000 − $3,000 = $2,000 under periodic weighted average. Under the perpetual moving average it is $5,000 − $2,940 = $2,060. FIFO would give $2,200 and LIFO $1,800. Because the average method sits in the middle, analysts often use it as a neutral point of comparison.
The averaging also means the method lags. When costs jump, the average rises only in proportion to the share of new units in the pool. The ending inventory is therefore not as close to current replacement cost as FIFO's ending inventory, and COGS is not as close to current cost as LIFO's COGS.
Rules and valuation
Weighted average cost is permitted under both US GAAP and IFRS, and IFRS (IAS 2) allows it alongside FIFO while prohibiting LIFO. A company must apply the same method to inventories with a similar nature and use, and must apply it consistently from period to period. Changing methods requires disclosure of the change and its effect.
Inventory carried at weighted average cost, as with FIFO, is tested at the lower of cost and net realizable value. If the net realizable value of the inventory falls below its blended cost, you write it down. The blended cost is the starting point for that comparison, so a bad purchase price that is blended into the average can hide a loss until the whole pool is tested.
Checking your work
Use these checks on any weighted average problem:
- Goods available for sale equals COGS plus ending inventory.
- The average cost lies between the lowest and highest unit costs in the pool.
- Under perpetual, the average only changes after a purchase at a different unit cost.
- Units on hand equal units available minus units sold, and never go negative.
Exercise
A company starts with 50 units at $8. It buys 150 units at $12 on day 3 and sells 100 units on day 6. Then it buys 100 units at $14 on day 9 and sells 120 units on day 12. Using the perpetual moving average method, what is the total COGS and the ending inventory cost?
Show answer
Start: 50 units, $400. After day 3: 200 units, $400 + $1,800 = $2,200, average $11.00. Day 6 sale of 100 units costs $1,100, leaving 100 units and $1,100. After day 9: 200 units, $1,100 + $1,400 = $2,500, average $12.50. Day 12 sale of 120 units costs $1,500, leaving 80 units and $1,000. Total COGS is $1,100 + $1,500 = $2,600 and ending inventory is $1,000. Check: $2,600 + $1,000 = $3,600, which is $400 + $1,800 + $1,400.
Exercise
Using the same company and the same transactions as the previous exercise, compute COGS and ending inventory under the periodic weighted average method, with 220 units sold in total. Why does it differ from the perpetual result?
Show answer
Goods available are 300 units costing $400 + $1,800 + $1,400 = $3,600, so the average is $12.00. COGS is 220 × $12.00 = $2,640 and ending inventory is 80 × $12.00 = $960. Check: $2,640 + $960 = $3,600. COGS is $40 higher than the perpetual figure of $2,600 because the periodic average includes the $14 purchase from day 9, so the day-6 sale is costed with a purchase that had not happened yet. In a perpetual system, the day-6 sale uses only costs known by day 6.