Last updated on November 3rd, 2026 at 04:28 pm
The harmonic mean formula for positive values is H = n / (1/x₁ + 1/x₂ + … + 1/xₙ). First, take the reciprocal of each value, add the reciprocals, divide that sum by n, then take the reciprocal of the result. Use it when the structure of the problem calls for averaging rates with the appropriate weights.

Harmonic mean formula for two and three numbers
For two positive values a and b: H = 2ab / (a + b). For three positive values a, b and c: H = 3abc / (ab + ac + bc).
Worked example: average of 1, 2, 3 and 4
First, add the reciprocals: 1 + 1/2 + 1/3 + 1/4 = 25/12. Therefore H = 4 / (25/12) = 48/25 = 1.92. In contrast, the arithmetic mean is (1 + 2 + 3 + 4) / 4 = 2.5. However, neither result is a universal replacement for the other; they answer different averaging questions.
How should you calculate average speed?
Suppose a driver covers 60 km at 30 km/h, then another 60 km at 60 km/h. The distances are equal. As a result, the first leg takes two hours and the second takes one hour. Therefore, total distance is 120 km and total time is three hours, giving an average speed of 40 km/h.
The harmonic calculation agrees: 2 / (1/30 + 1/60) = 40. In contrast, the arithmetic mean, 45, would be wrong for this equal-distance trip. If the driver instead spent one hour at each speed, the distances would be 30 km and 60 km, and the correct average would be 45 km/h. Therefore, always start with total distance divided by total time.
Weighted harmonic mean formula
For positive values xᵢ and non-negative weights wᵢ with a positive total weight:
H = Σwᵢ / Σ(wᵢ/xᵢ).
First, divide each weight by its corresponding value, add those terms, then divide the total weight by the sum. However, the weights do not have to add to one. If they do add to one, the numerator simplifies to 1.
An original portfolio P/E example
A simplified portfolio invests 25% of its market value in a company trading at 20 times earnings and 75% in a company trading at 10 times earnings. Here, both earnings figures are positive and measured on a consistent basis. Its look-through earnings yield is 0.25/20 + 0.75/10 = 0.0875. The corresponding P/E is 1/0.0875 = 11.43 times.
For example, we can check this with a ₹100 investment: ₹25 buys ₹1.25 of proportionate earnings and ₹75 buys ₹7.50. As a result, total earnings are ₹8.75, so ₹100/₹8.75 = 11.43. In contrast, a weighted arithmetic average gives 12.5, which is not the aggregate price-to-earnings ratio in this case. However, loss-making companies need separate treatment; do not feed negative or zero P/E values into this positive-value example.
How to handle frequency data
Use H = Σf / Σ(f/x), where f is the frequency of each positive value. For values 2, 4 and 8 with frequencies 1, 2 and 1, total frequency is 4. The denominator is 1/2 + 2/4 + 1/8 = 1.125, so H = 4/1.125 = 3.5556. In contrast, for grouped class intervals, using class midpoints gives an approximation, which should be labelled.
Use the harmonic mean formula in Excel
First, enter the positive observations in B2:B5 and use =HARMEAN(B2:B5). For the values 1, 2, 3 and 4, the result is 1.92. For weighted data in B2:B4 with weights in C2:C4, use =SUM(C2:C4)/SUMPRODUCT(C2:C4,1/B2:B4). First, check for blanks, zero values and inconsistent weights before interpreting the result.
Excel’s HARMEAN function returns a #NUM! error if a data point is zero or negative. However, a negative number has a mathematical reciprocal, but the standard positive-rate averaging interpretation and this Excel function do not support using negative inputs indiscriminately.
Harmonic mean versus arithmetic and geometric mean
| Question | Useful starting point |
|---|---|
| Average equally weighted marks | Arithmetic mean: Σx/n; do not switch solely to suppress one high mark. |
| Average speed across equal distances | Harmonic mean of positive speeds. |
| Constant compound growth rate across equal time periods | Geometric mean of growth factors, then subtract 1. |
| Aggregate positive portfolio P/E | Market-value-weighted harmonic mean, with consistent earnings definitions. |
For positive observations, H ≤ G ≤ A. In contrast, all three means are equal when all observations are equal. However, harmonic mean is sensitive to small positive values. Do not use it as a general outlier-removal tool.
For further finance practice, use our ratio analysis questions and worked solutions. Also, see the Excel LOOKUP tutorial when you need to retrieve values rather than average them.
Why the harmonic mean formula uses reciprocals
Start with the unit you are trying to average. A speed of 30 kilometres per hour has a reciprocal of 1/30 hour per kilometre. For equal distances, those time-per-kilometre values add in the correct way. Inverting their average brings the unit back to kilometres per hour.
For example, dividing 60 kilometres by 30 kilometres per hour gives two hours. Dividing the same distance by 60 gives one hour. Therefore, the slower leg consumes more of the total time. A simple average of 30 and 60 misses that fact because it gives each speed equal time weight.
This is why “use the harmonic mean for rates” is incomplete advice. First ask what quantity is held fixed. Then derive the overall rate from the totals. The harmonic mean formula should agree with that economic or physical calculation.
Weighted harmonic mean formula for unequal distances
Suppose a driver covers 90 kilometres at 30 km/h and then 30 kilometres at 60 km/h. The distances differ, so an unweighted harmonic mean would give the wrong trip average.
| Leg | Distance | Speed | Time |
|---|---|---|---|
| First | 90 km | 30 km/h | 90/30 = 3 hours |
| Second | 30 km | 60 km/h | 30/60 = 0.5 hours |
Therefore, average speed = 120/3.5 = 34.2857 km/h. The weighted harmonic mean gives the same result: (90 + 30)/(90/30 + 30/60). In this case, distance supplies the weights. However, equal time periods would call for a time-weighted arithmetic average instead.
When not to use the harmonic mean formula
Do not use it simply to reduce an outlier
The harmonic average gives small positive values substantial influence, but that does not make it a general outlier-removal tool. For example, consider equally weighted marks of 10, 10 and 100. Their arithmetic mean is 40. The harmonic mean is 3/(0.1 + 0.1 + 0.01) = about 14.29. The second number answers a different question; it does not automatically provide a fairer class average.
Therefore, investigate whether the high mark is an error, a genuine result or evidence that another summary is useful. Choose the measure because it fits the question, not because it produces a preferred number.
Do not average investment returns as if they were P/E ratios
A P/E ratio and a return series have different structures. For example, a 20% gain followed by a 20% loss leaves ₹100 at ₹96. The two-year compound annual rate is √0.96 − 1, or about −2.02%. A harmonic average of the two percentage returns does not answer that compounding question.
Do not mix inconsistent earnings definitions
Our portfolio example uses positive earnings measured on the same basis. A trailing P/E for one company and a forecast P/E for another would not describe a consistent aggregate. Similarly, losses or near-zero earnings can make a headline multiple misleading. Check the underlying price and earnings before applying an averaging shortcut.
Harmonic mean formula for grouped data
Frequency data gives exact positive values and their counts. Grouped intervals only tell us where observations fall. Using each class midpoint therefore produces an estimate, not the exact harmonic mean of the original observations.
| Class interval | Frequency f | Midpoint x | f/x |
|---|---|---|---|
| 10–20 | 2 | 15 | 2/15 = 0.133333 |
| 20–30 | 3 | 25 | 3/25 = 0.120000 |
Total frequency is five and Σ(f/x) = 0.253333. Therefore, the estimated harmonic mean is 5/0.253333 = 19.7368. For an exact answer, use the original positive observations. Also, show unrounded intermediate values in the calculation where possible.
Harmonic mean formula: quick practice answers
| Positive observations | Calculation | Harmonic mean |
|---|---|---|
| 2, 4 and 6 | 3/(1/2 + 1/4 + 1/6) | 36/11 = 3.2727 |
| 3, 4 and 5 | 3/(1/3 + 1/4 + 1/5) | 180/47 = 3.8298 |
| 5, 2, 8 and 10 | 4/(1/5 + 1/2 + 1/8 + 1/10) | 160/37 = 4.3243 |
| Two equal values of 7 | 2/(1/7 + 1/7) | 7 |
First, calculate each reciprocal. Then add them before dividing the observation count by the total. Finally, check that the result lies between the smallest and largest positive observation. For unequal positive observations, it should not exceed their arithmetic mean.
Questions about harmonic averages
What happens when an observation is zero?
The reciprocal 1/0 is undefined. In Excel, HARMEAN returns a #NUM! error for a zero or negative data point. Do not delete zero values silently to obtain a result. First decide what the zero means and whether the proposed average fits the task.
Is the harmonic mean always lower?
For positive observations, harmonic mean ≤ geometric mean ≤ arithmetic mean. Equality holds when all observations are equal. Therefore, “always strictly lower” is incorrect. More importantly, this ordering does not tell you which mean answers your question.
Can I use HARMEAN for weighted observations?
HARMEAN calculates the unweighted mean of the supplied positive observations. For explicit weights, use the weighted formula shown above. However, ensure that both ranges cover matching observations and that the weights represent the quantity your problem requires.
Download the harmonic mean practice workbook
Download the harmonic mean workbook (.xlsx) to practise the positive-value average, weighted portfolio P/E and equal-distance trip. The amber cells are inputs. Change one input and explain why the result changes before checking the formula.
Watch the statistics lesson
For the related lesson from Allen Aravindan, CFA, watch the quantitative methods video from the linked timestamp. Use the worked examples on this page for the exact assumptions used in these calculations.
Sources
Microsoft HARMEAN documentation
A CFA charterholder with hands-on experience across investment analysis and finance education. At MentorMeCareers, he writes and reviews content on CFA, financial modeling, and investment banking careers — grounded in real market data rather than generic advice, and shaped by what actually helps candidates and professionals succeed.



