There’s a different way of working out your cost if you’ve sold the same type of shares in a company that you bought at different times.
You’ll usually need to work out the average cost of your shares and deduct this from what you got for them to work out your gain.
You buy 100 shares for 80p each. The total cost is £80.
You later buy 300 shares for £1.20 each. The total cost is £360.
In total, you have 400 shares costing £440 - the average cost of each share is £1.10.
If you sell 150 shares, the cost of the shares for your tax calculations is £165 (£1.10 multiplied by 150). Deduct this from what you sold the shares for to work out your gain.
If you bought new shares of the same type in the same company within 30 days of selling your old ones, there are special rules for working out the cost to use in your tax calculations.