Calculating Harmonic Mean
Harmonic mean is calculated by dividing the number of observations (n) by the sum of reciprocals of all observations.

Harmonic mean has some applications in finance. One application is to calculate the average purchase cost of shares purchased over time.
Let’s say that an investor purchased a stock worth $100 for two months. The share price at the time of each purchase was 5 and 7. What will be the average purchase price? We can calculate this as follows.
The number of stocks purchased in the two months are $100/5 = 20 and $100/7 = 14.286. Total number of shares purchased is 34.286 for a total cost of $200. Average purchase price will be = $200/34.286 = 5.833. This is in fact the harmonic mean.
We can use the harmonic mean formula to calculate this.

The relationship between Harmonic Mean, Arithmetic Mean, and Geometric Mean is as given below:
Harmonic Mean < Geometric Mean < Arithmetic Mean