Gainsheet · UK crypto tax, worked out

Section 104 pool calculator for crypto, in Excel

Bought the same coin at five different prices? HMRC doesn't use any one of them. It uses your average cost across every purchase, which is the "Section 104 pool". Here's how it works, how to build it in Excel, and where a simple version goes wrong.

What the Section 104 pool is

For each type of token you hold, HMRC treats all your coins as one pot with one total cost (CRYPTO22200). Every purchase adds coins and cost to the pot. Every sale takes out coins, along with a proportional slice of the cost.

Allowable costs like exchange fees are added to the cost when you buy, and deducted from proceeds when you sell.

Worked example: Bitcoin

DateEventBTC£ paid / receivedPool BTCPool cost £
3 Jun 2024Buy0.510,0000.510,000
8 Jan 2025Buy0.520,0001.030,000
15 Aug 2025Sell0.416,0000.618,000

The gain on the August sale

Step£
Proceeds16,000
Allowable cost: £30,000 × (0.4 ÷ 1.0)(12,000)
Gain4,000

The pool carries on with 0.6 BTC at £18,000, an average of £30,000 per BTC. The next sale takes its cost from there.

The Excel formulas

For a single token, with trades in date order (column B = "Buy" or "Sell", C = quantity, D = £ amount including fees), the running pool is:

ColumnMeaningFormula (row 3)
EPool quantity=E2 + IF(B3="Buy", C3, -C3)
FCost taken out on a sale=IF(B3="Sell", G2 * C3 / E2, 0)
GPool cost=G2 + IF(B3="Buy", D3, -F3)
HGain on a sale=IF(B3="Sell", D3 - F3, "")

Row 2 holds your opening pool (zero if you're starting fresh). Copy row 3 down for every trade.

Why this simple sheet isn't enough on its own: the pool is the last of three matching steps. Before any sale touches the pool, HMRC matches it with coins bought the same day, then with coins bought in the next 30 days. Those matched coins never enter the pool. A pure average-cost sheet gets the answer wrong whenever you've bought back within 30 days. See the 30-day rule worked example.

Other things the pool has to handle

A ready-made version

Gainsheet is an Excel workbook that does all of this: same-day, then 30-day, then Section 104 matching, for every token, with imports for Coinbase, Kraken and Binance, Bank of England FX, and the SA108 box figures at the end. Nothing is hidden: every match is a formula you can click into and check. No macros, and your data never leaves your computer.

Start free: a one-page cheat sheet of the 7 rules, or the Lite workbook (20 transactions).
Free cheat sheet Free Lite workbook Full version (£39)