Calculate the harmonic mean of a set of positive numbers, ideal for rates and ratios.
The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals. It is always ≤ the arithmetic mean and is the correct average for rates (like speed, efficiency, or price-to-earnings ratios).
Harmonic Mean
H = n / (1/x₁ + 1/x₂ + ... + 1/xₙ)
Use it when averaging rates. For example, if you drive 40 km/h on the way out and 60 km/h on the return (same distance), the average speed is the harmonic mean: 2/(1/40+1/60) = 48 km/h, not the arithmetic mean of 50.
A zero value would make its reciprocal infinite, and negative values would cancel in ways that make the harmonic mean meaningless or undefined.