Accounting & Audit
By Fadhil Abdulla

FIFO vs LIFO vs Weighted Average: Worked Example

How the three inventory costing methods work, a worked example of their effect on COGS and profit, which are allowed under IFRS, and how to choose.

Editorial disclosure: Pyalm publishes and maintains the products and free tools discussed on this site. Regulatory statements are linked to primary sources where applicable. No independent professional review is claimed unless a reviewer is explicitly named.

When you buy the same item at different prices over time, you need a rule for which cost goes to cost of goods sold (COGS) and which stays in closing inventory. That rule is your inventory costing method, and it changes reported profit.

The three methods

  • FIFO (first in, first out): the oldest costs are assumed sold first. Closing stock carries the most recent costs.
  • LIFO (last in, first out): the newest costs are assumed sold first. Closing stock carries the oldest costs.
  • Weighted average: all costs are blended into one average cost per unit.

A worked example

Opening stock 100 units @ 10, purchases of 150 @ 12 and 200 @ 14. Total available: 450 units costing 5,600. You sell 320 units at 20 each, so revenue is 6,400.

Method COGS Closing stock Gross profit
FIFO 3,780 1,820 2,620
LIFO 4,240 1,360 2,160
Weighted average 3,982 1,618 2,418

How each is worked out:

  • FIFO: 100 × 10 + 150 × 12 + 70 × 14 = 1,000 + 1,800 + 980 = 3,780.
  • LIFO: 200 × 14 + 120 × 12 = 2,800 + 1,440 = 4,240.
  • Weighted average: 5,600 ÷ 450 = 12.44 per unit, so COGS = 320 × 12.44 = 3,982.

Because prices rose, FIFO gives the lowest COGS and therefore the highest profit; LIFO gives the highest COGS and the lowest profit; the average sits between. In falling prices the order reverses.

What's allowed

  • IFRS (IAS 2) permits FIFO and weighted average cost. LIFO is not permitted. UAE businesses reporting under IFRS therefore use FIFO or weighted average.
  • US GAAP allows LIFO.
  • Whatever you choose must be applied consistently to inventories of a similar nature; changing it is a change in accounting policy requiring disclosure.
  • Tax treatment may differ — confirm with your adviser.

Periodic vs perpetual

  • Periodic: costs are matched to units sold at period end using totals (what the calculator below does).
  • Perpetual: cost is updated after every purchase and sale. With perpetual weighted average ("moving average") the figures can differ from periodic when buying and selling interleave.

Choosing a method

Situation Often suits
Perishables, fashion, tech — oldest stock really sells first FIFO
Fungible bulk goods (fuel, grain, chemicals) Weighted average
Simplicity with many small purchases Weighted average

Pick the method that best reflects the actual flow of goods and is supportable under your reporting framework.

Net realisable value

Under IAS 2, inventory is carried at the lower of cost and net realisable value. Write stock down when selling prices fall below cost, damage occurs or items become obsolete.

Compare them on your own numbers

Enter opening stock, purchases and units sold into the free Inventory Valuation Calculator to see COGS, closing stock and gross profit under all three methods side by side. For the basics see the COGS Calculator, COGS and gross profit for trading businesses and inventory turnover explained.

Costing is easier when stock and accounting share one ledger. Pyalm Books tracks products with cost and price, real-time stock levels and transfers between stores, with sales and purchases posting to the ledger — free during beta.

Standards, rates and deadlines change. Confirm the current position with the relevant authority or a qualified adviser before you rely on it.

Keep reading

More from Pyalm

Oct 16, 2026

Benford's Law for Auditors: A Practical Guide

How Benford's Law works, which ledgers it suits, how to read MAD and chi-square, and what to do when the first-digit test flags something.

Oct 16, 2026

Audit Sampling Explained: Attribute Sampling & MUS

Attribute sampling for controls, monetary unit sampling for balances, sample size tables and reproducible random selection under ISA 530.

Oct 16, 2026

Audit Materiality Explained: Overall to Trivial

How auditors set materiality under ISA 320: choosing a benchmark and percentage, then deriving performance materiality and the trivial threshold.

Oct 16, 2026

Bank Reconciliation Step by Step, With Examples

How to reconcile a bank statement to your ledger: the steps, the usual reconciling items, a worked example and how to speed it up with matching.

Oct 16, 2026

How to Find Duplicate Payments and Invoices

Why duplicate payments happen, the exact and fuzzy tests that find them, how to tune the date window, and the controls that stop them recurring.

Oct 16, 2026

Missing Invoice Numbers: Testing Sequence Gaps

Why invoice numbering gaps draw questions from auditors and tax authorities, how to test a sequence, and how to document legitimate voids.

Try the free Inventory Valuation Calculator (FIFO, LIFO, Average)

Pyalm Books tracks products with cost and price, real-time stock levels and transfers between stores, with every sale and purchase posting to the ledger.

Open Inventory Valuation Calculator (FIFO, LIFO, Average) Start free on Pyalm Books All free tools