How to calculate average price of share?

How do I calculate the average price of a share? Does this help when deciding whether to buy or sell?