How is it calculated?
For each purchase the quantity is multiplied by the price, and the total paid is divided by the total quantity. This is a weighted average.
Example
10 units at 25.50, 20 at 24 and 15 at 27.80: average 25.60.