Sub topic 3
Assigning cost: FIFO and weighted average
This chapter assumes you can post double-entry journals and know how cost of sales and gross profit appear on the income statement. It also assumes you know which costs enter inventory cost, which the previous chapter covered. Here the question is different. Once you know what each purchase cost, how much of that cost belongs to the units sold, and how much stays in inventory?
Why a cost formula is needed
When identical units are bought at different prices, the units on the shelf do not carry price tags from their purchase. The entity must therefore assume which costs left with the sales and which remain. That assumption is a cost formula. IAS 2 allows three:
- Specific identification.
- First-in, first-out (FIFO).
- Weighted average cost.
Every cost formula splits the same total:
Cost of opening inventory + cost of purchases = cost of sales + cost of closing inventory
The formula decides only how the total is divided. It does not change the total. The closing inventory figure is the "cost" that the lower of cost and NRV rule later compares with net realisable value.
Specific identification
Specific identification tracks the actual cost of each individual item. IAS 2 requires it for items that are not ordinarily interchangeable, and for goods or services produced and segregated for specific projects. Examples are a custom-built yacht, a painting held by a dealer, or a construction contract's materials.
It is inappropriate when there are large numbers of interchangeable items. An entity could pick which units "were sold" and so choose its profit. For interchangeable goods, IAS 2 requires FIFO or weighted average.
FIFO
FIFO assumes the items bought first are sold first. Cost of sales therefore takes the oldest cost layers, and closing inventory consists of the most recent purchases.
FIFO describes the flow of costs, not the flow of goods. A warehouse may physically ship the newest boxes first, and the entity can still use FIFO. A particular physical flow is not required.
Weighted average
Weighted average gives every unit the same average cost. There are two common ways to calculate it.
- Periodic. At the end of the period, divide the total cost of goods available by the total units available. Apply that single rate to units sold and units remaining.
- Moving (perpetual). Recalculate the average after every purchase. Each sale is costed at the average that applies on the sale date.
IAS 2 says the average may be calculated periodically or on receipt of each shipment, depending on the entity's circumstances. The two methods usually give different answers when sales happen between purchases.
A worked example
An entity has these movements in March for one product.
| Event | Units | Unit cost | Total cost |
|---|---|---|---|
| Opening inventory | 100 | 10 | 1,000 |
| Purchase, 5 March | 200 | 12 | 2,400 |
| Sale, 12 March | 150 | ||
| Purchase, 20 March | 100 | 14 | 1,400 |
| Sale, 28 March | 180 |
The cost of goods available is 1,000 + 2,400 + 1,400 = 4,800 for 400 units. The entity sells 330 units and has 70 left.
FIFO calculation
The 330 units sold come from the oldest layers first:
- 100 units at 10 = 1,000
- 200 units at 12 = 2,400
- 30 units at 14 = 420
Cost of sales is 3,820. The 70 units left are all from the 20 March purchase: 70 × 14 = 980. Check: 3,820 + 980 = 4,800.
Periodic weighted average calculation
The average cost is 4,800 ÷ 400 = 12.00 per unit. Cost of sales is 330 × 12 = 3,960, and closing inventory is 70 × 12 = 840.
Moving average calculation
- After the 5 March purchase there are 300 units costing 3,400, an average of 11.3333.
- The 12 March sale of 150 units costs 150 × 3,400 ÷ 300 = 1,700. This leaves 150 units costing 1,700.
- The 20 March purchase gives 250 units costing 3,100, an average of 12.40.
- The 28 March sale of 180 units costs 180 × 3,100 ÷ 250 = 2,232. This leaves 70 units costing 868.
Cost of sales is 1,700 + 2,232 = 3,932, and closing inventory is 868.
Comparing the results
| Formula | Cost of sales | Closing inventory | Total |
|---|---|---|---|
| FIFO | 3,820 | 980 | 4,800 |
| Weighted average, periodic | 3,960 | 840 | 4,800 |
| Weighted average, moving | 3,932 | 868 | 4,800 |
Purchase prices rose from 10 to 14 during the month. In a period of rising prices, FIFO gives the lowest cost of sales, so the highest profit, and the highest closing inventory. In a period of falling prices the ranking reverses. Averaging smooths the effect, so its results fall between the extremes.
The same calculation in code
This script implements all three methods. The sales contain no cost information, so each method has to work out the cost itself.
from collections import deque
events = [
("buy", 100, 10.0),
("buy", 200, 12.0),
("sell", 150, None),
("buy", 100, 14.0),
("sell", 180, None),
]
def fifo(events):
layers = deque() # each layer is [units, unit cost], oldest on the left
cost_of_sales = 0.0
for kind, qty, price in events:
if kind == "buy":
layers.append([qty, price])
else:
remaining = qty
while remaining > 0:
layer = layers[0]
take = min(remaining, layer[0])
cost_of_sales += take * layer[1]
layer[0] -= take
remaining -= take
if layer[0] == 0:
layers.popleft()
closing = sum(units * cost for units, cost in layers)
return cost_of_sales, closing
def periodic_average(events):
bought_units = sum(q for k, q, p in events if k == "buy")
bought_cost = sum(q * p for k, q, p in events if k == "buy")
sold_units = sum(q for k, q, p in events if k == "sell")
average = bought_cost / bought_units
return sold_units * average, (bought_units - sold_units) * average
def moving_average(events):
units, value, cost_of_sales = 0, 0.0, 0.0
for kind, qty, price in events:
if kind == "buy":
units += qty
value += qty * price
else:
cost = qty * value / units # sell at the current average
cost_of_sales += cost
units -= qty
value -= cost
return cost_of_sales, value
for name, method in [
("FIFO", fifo),
("Periodic average", periodic_average),
("Moving average", moving_average),
]:
cos, closing = method(events)
print(name, "cost of sales", f"{cos:.2f}", "closing inventory", f"{closing:.2f}")
# FIFO cost of sales 3820.00 closing inventory 980.00
# Periodic average cost of sales 3960.00 closing inventory 840.00
# Moving average cost of sales 3932.00 closing inventory 868.00Closing inventory in the moving average method is the running residual (value), not units multiplied by a rounded average. This guarantees that cost of sales plus closing inventory equals the cost of goods available.
Rules for choosing and applying a formula
- One formula per type of inventory. IAS 2 requires the same cost formula for all inventories with a similar nature and use to the entity.
- Different formulas for different types. Inventories with a different nature or use may justify a different formula. For example, a manufacturer may use FIFO for raw materials and specific identification for custom projects.
- Geography is not a justification. A different location or tax rule does not on its own justify a different formula for the same kind of inventory.
- LIFO is not allowed. IAS 2 does not permit last-in, first-out, because it can leave closing inventory at very old costs.
- Changing the formula is an accounting policy change. It must be applied retrospectively under IAS 8 and needs a justification that the new policy gives more relevant and reliable information.
IAS 2 also allows techniques such as standard cost and the retail method as a convenience, if the result approximates cost. They are not separate cost formulas. They are shortcuts, and they are reviewed against actual costs regularly.
Common errors
- Mixing periodic and moving averages. If you average the whole month and then also cost each sale at the running average, the totals will not reconcile. Pick one.
- Leaving out opening inventory. The opening balance is the first cost layer, and it belongs in the average.
- Rounding the average too early. Rounding 11.3333 to 11.33 makes the closing balance drift. Carry full precision, or compute closing inventory as the residual.
- Treating FIFO as a physical rule. An entity does not need to ship oldest stock first.
- Costing a purchase return at the current average. Goods returned to a supplier are removed at the cost of that purchase. Under the average method, the effect on the pool is the returned units at the price actually paid.
- Confusing cost with NRV. The formula gives cost only. A fall in selling prices does not change the FIFO or average figure. It is dealt with afterwards through the lower of cost and NRV test.
Exercises
Exercise
An entity has opening inventory of 50 units at 8 each, then buys 50 units at 10 each, and then sells 60 units. Calculate cost of sales and closing inventory under FIFO and under periodic weighted average.
Show answer
Cost of goods available is 50 × 8 + 50 × 10 = 900 for 100 units. FIFO: cost of sales is 50 × 8 + 10 × 10 = 500, and closing inventory is 40 × 10 = 400. Periodic weighted average: the average is 900 ÷ 100 = 9, so cost of sales is 60 × 9 = 540 and closing inventory is 40 × 9 = 360. Both methods total 900.
Exercise
A retailer holds identical goods in two warehouses, one in each of two countries. It uses FIFO in one warehouse and weighted average in the other, arguing that the locations differ. Is this acceptable under IAS 2, and why?
Show answer
No. IAS 2 requires the same cost formula for inventories of a similar nature and use, and a different geographical location does not justify a different formula. The goods are identical, so the retailer should use one formula (FIFO or weighted average) for both warehouses.
Exercise
Purchase prices rise throughout a period and there is no change in selling prices. Which of FIFO and weighted average gives the higher gross profit, and which gives the higher closing inventory?
Show answer
FIFO gives both. It charges the older, cheaper costs to cost of sales, so gross profit is higher. It leaves the newer, more expensive costs in closing inventory, so closing inventory is higher.