What is harmonic mean?
The harmonic mean is a type of average that is especially useful when working with ratios or rates. It is calculated by dividing the number of values in the data series by the sum of the reciprocals of each value in the series. Compared to other types of averages, such as arithmetic and geometric means, harmonic averages give equal weight to each data point and are suitable when values are in a ratio or rate relationship.
In finance, the harmonic mean finds application in determining the average for financial multiples, such as the pricetoearnings (P/E) ratio. When averaging financial multiples, it is not advisable to use the arithmetic mean because it can be biased towards larger values, potentially distorting the overall average. The harmonic mean provides a more balanced approach by giving equal weight to each value, which is desirable in cases where the values represent different securities in a portfolio, for example. Thus, the harmonic mean helps in calculating the ratio of a portfolio that consists of multiple securities by providing a fair representation of the average.
Formula for Harmonic Mean
The general formula for calculating a harmonic mean is:
Harmonic mean = n / (∑1/x_i)
Where:

n – the number of the values in a dataset

x_i – the point in a dataset
You can calculate the weighted harmonic mean using the following formula:
Weighted Harmonic Mean = (∑w_i ) / (∑w_i/x_i)
Where:

w_i – the weight of the data point

x_i – the point in a dataset
Example of Harmonic Mean
You are an investment banker and are required to determine the P/E ratio of the index of Companies A and B. Company A reports a market cap of $1 billion and a profit of Rs.20 million, while Company B reports a market cap of Rs.20 billion and a profit of Rs.5 billion. The index consists of 60% of Company B and 40% of Company A.
First, find the P/E ratios of both companies. Remember that the P/E ratio is essentially the market cap divided by the profit.
P/E (Company A) = (Rs.1 billion) / (Rs.20 million) = 50
P/E (Company B) = (Rs.20 billion) / (Rs.5 billion) = 4
This weighted harmonic mean is used to calculate the P/E ratio of the index. P/E (Index) = (0.4+0.6) / (0.4/50 + 0.6/4) = 6.33
Note: On calculating the P/E ratio of the index using the weighted arithmetic mean, it would be overstated 
P/E (Index) = 0.4×50 + 0.6×4 = 22.4