The formula
average = total invested ÷ total units
Where it comes from
The average cost of a position is the total money in divided by the total units held. It is a weighted average, so a big purchase moves it far more than a small one, which is why averaging the prices themselves gives the wrong answer.
How to work it out by hand
- Multiply each purchase's quantity by its price to get the amount spent
- Add up all the amounts spent
- Add up all the units bought
- Divide the total spent by the total units
What is worth knowing
This figure is your break-even before costs, and it is the anchor most people use to decide when to sell — usually to their cost. What you paid has no bearing on what the asset will do next, and refusing to sell below your average is the disposition effect, one of the best documented mistakes in investing. Two practical notes: commissions belong in the total spent if you want a true break-even, and this weighted average is the cost basis method used in many countries for tax, though some require FIFO instead, which can give a very different taxable gain.