Hi.Disposals of shares in the same company must be identified using the following ordered process:1 Shares bought and sold on the same day are, as far as is possible, identified with one another.2 Shares bought within 30 days after a disposal are matched, as far as is possible, with that disposal.3 Shares disposed of and not matched through either 1 or 2 above are identified with the Section 104 pool which increases and decreases in size as shares are bought and sold.There are some examples here.I hope this helps but let me know if you have any further questions.
Assuming your disposal is not covered by 1 and 2 in my previous post, you add the costs of your two purchases together to arrive at a pooled cost. You do the same with the shares to arrive at the number of shares in the pool. You then divide the cost by the total number of shares in the pool to arrive at the averaged cost of one share. That is then multiplied by the number of shares sold to arrive at the cost of the shares sold.