How weighted average cost works and how it differs from last purchase cost
Who it is forGrocery chain finance, buying, cost accounting, ERP owners
The same stock has a different cost depending on the method chosen, and during periods of high inflation that difference shifts margin by up to ten points. The choice between weighted average, last purchase and FIFO looks like an accounting preference but it drives pricing directly: a price set on the wrong cost basis produces a sale that looks profitable on paper yet cannot fund a replacement. This guide runs all three methods over the same data and shows where the difference goes.
How weighted average cost is calculated
Weighted average cost is the total value of all stock on hand divided by the total units. It is weighted because each purchase counts in proportion to its quantity: a hundred-unit purchase carries ten times the weight of a ten-unit one.
There are two implementations. Under the periodic weighted average the calculation runs once at month end and every issue in that month is valued at the same cost. Under the moving weighted average a new average is calculated on every receipt and subsequent issues are valued at it.
For retail the moving average is the correct one. The periodic method values goods sold during the month at a figure only known at month end, so margin cannot be seen intraday and the correct cost is not known at the point of sale.
- Weighted average cost
Total inventory value ÷ Total units on hand- Moving average (on receipt)
(Current stock value + New receipt value) ÷ (Current units + New units)- Value of an issue
Units issued × Weighted average cost at that moment
Issues do not change the average; they reduce total value and units together. The average only moves on receipt.
Three methods, one dataset, three answers
Value the movements above under three methods and both closing inventory and cost of goods sold differ. Total profit over the long run is the same; what changes is the period in which it appears.
In a rising-price environment FIFO produces the lowest cost of goods sold and therefore the highest profit, because the cheap goods that came in first are treated as going out first. Last purchase cost produces the highest cost and the lowest profit. Weighted average sits between them.
The tax and management consequences differ. For statutory reporting, average cost and FIFO are the accepted methods in Türkiye. For management purposes you also need last purchase cost visible for pricing; that is held as a second field without changing the accounting entry.
| Method | Cost of goods sold | Closing inventory value | Margin effect |
|---|---|---|---|
| Moving weighted average | ₺78,571 | ₺127,429 | Middle — smooths volatility |
| FIFO (first in, first out) | ₺74,800 | ₺131,200 | Highest profit, highest stock value |
| Last purchase cost | ₺98,000 | ₺140,000 | Lowest profit, reflects replacement cost |
Which method is right when
The question is not "which is correct" but "which is correct for which decision". The three methods answer three different questions and a serious system can calculate all three at once.
For accounting and tax, weighted average or FIFO is used; both comply and consistency between periods is what matters. Once chosen, the method is not switched at will.
For pricing, last purchase cost — more precisely replacement cost — is used. Price a product by putting a margin on the average cost and you may not earn enough to buy the next one. During high inflation that gap quietly shrinks the business.
| Decision | Cost basis to use | Why |
|---|---|---|
| Income statement and tax | Weighted average or FIFO | Compliant and consistent between periods |
| Setting the selling price | Last purchase / replacement cost | The goods have to be replaceable |
| Category profitability | Weighted average | Smooths one-off purchase volatility |
| Markdown decision | Weighted average | This is the capital actually tied up in the stock on hand |
| Supplier negotiation | Last invoice cost | It is the number the other side is also talking about |
Showing both costs on the same screen is the most practical answer: keep weighted average and last purchase cost together on the product record. The user knows which number they are reading and the system says which decision it supports.
How far periodic and moving weighted average diverge on the same data
The difference between the two is not in the formula but in when the calculation happens. Under the periodic method every batch received during the month is pooled into a single average and all of the month's issues are valued at that one cost. Under the moving method the average is refreshed on every receipt and each issue is valued at the cost in force at that moment.
The gap widens when prices rise during the month. Value the same movements both ways and cost of goods sold and closing stock move in opposite directions: what one loses the other gains, and the total stays the same.
For management the problem is not the amount but the timing. Under the periodic method the cost of a sale made on the first day of the month is only known once the month closes; margin cannot be calculated at the moment of sale and markdown decisions are taken without knowing cost.
The periodic method values the first sale of the month at the price of goods that had not yet been bought when the sale happened. Acceptable for the accounts; not for the margin shown on a store screen.
How costing works in Mindpera
Mindpera calculates product cost as a moving weighted average: the average is recalculated on every goods receipt rather than waiting for a period-end run. The cost in force at the moment of sale is known, so margin can be read during the day.
Last purchase cost sits in a separate column on the same row. Neither figure is written over the other; the user knows which cost they are looking at. The gap between them is broken down into purchase batch, expense item and currency effect, which turns it from an argument into a calculation.
Items that change cost after the fact are processed retroactively. Freight, customs, insurance and price-difference invoices that arrive after the goods are in the warehouse are allocated to the batch, and the averages after that batch are recalculated.
- The average updates on receipts only; an issue reduces total value and units together
- Inter-store transfers carry cost rather than recalculating it
- A customer return goes back into stock at the cost in force when it was sold
- An alert goes to the pricing owner when last purchase cost crosses its threshold
The accounting entry is made with one cost; the second column is there for the decision, not the record. How a price is built from that second column is covered in the replacement cost guide.
What breaks the weighted average
Even a correctly configured method can be broken by certain movements. Three are common and all three corrupt the margin report without being noticed.
The first is returns. At what cost does a customer return re-enter stock: the average at the time of sale, or today's average? The correct answer is the cost at the time of sale; otherwise the return artificially moves the average.
The second is inter-store transfers. A transfer is not a purchase; the cost must move with the goods unchanged. Systems that process transfers as receipts corrupt the average at the receiving store. The third is negative stock: when goods not in the record are sold, cost is written at zero or at the last known value, and entering the goods later does not repair the average.
- Customer returns — must re-enter at the cost at the time of sale, not today's average
- Inter-store transfers — cost is carried, not recalculated
- Negative stock — the issue cost must be corrected afterwards or the average stays broken
- Purchase discounts and volume rebates — must be allocated back into cost when they arrive
Frequently asked questions
- How is weighted average cost calculated?
- Total inventory value is divided by total units. When 150 units worth ₺93,000 are received into stock of 60 units valued at ₺30,000, the new average is (30,000 + 93,000) ÷ 210 = ₺585.71.
- What is moving weighted average cost?
- A method where the average cost is recalculated on every goods receipt and issues are valued at the current average. It is the correct method for retail, because the cost has to be known at the moment of sale.
- Should I use weighted average or last purchase cost?
- Both, for different decisions. Weighted average for the income statement and tax, last purchase cost for setting selling prices. Pricing off average cost during inflation does not earn enough to replace the goods sold.
- What is the difference between weighted average and FIFO?
- FIFO assumes the oldest goods sell first and produces a lower cost of goods sold when prices are rising. Weighted average pools all stock at one cost and smooths volatility. Total profit over time is the same; what differs is the period it lands in.
- Do inter-store transfers change the average cost?
- They should not. A transfer is not a purchase; the cost moves with the goods. Systems that treat transfers as receipts corrupt the average at the receiving store and store-level margin reporting is never correct afterwards.