# How to use the HARMEAN function

*What is the HARMEAN function?*

The HARMEAN function lets you calculate the harmonic mean in Excel.

### Table of contents

## 1. Introduction

**What is the harmonic mean?**

The harmonic mean is a type of average that is useful for rates and ratios. It is calculated by taking the reciprocals of the values, averaging them, and reciprocating the result.

It gives more weight to smaller values compared to the arithmetic mean. The harmonic mean is useful when averaging rates and ratios instead of direct values.

The harmonic mean is always less than or equal to the arithmetic mean for a dataset. It is sensitive to small values which can skew or bias the average. Applications for the harmonic mean are averaging speed, fuel efficiency, ratios, and rates.

*How is the harmonic mean calculated?*

It is calculated by is calculated by dividing the number of values by the reciprocal of each value. For example, calculating the harmonic mean from numbers 2, 4, and 8 equals approx. 3.429

Here is how: 3/(1/2+1/4+1/8) equals approx. 3.429

To calculate the harmonic mean by hand use this formula:

H - harmonic mean

x1, x2, ..., xn - are the numbers

n is the number of values

*What is the difference between the harmonic mean and the arithmetic mean (average)?*

The difference between the harmonic mean and the arithmetic mean is that the harmonic mean is calculated by dividing the number of values by the reciprocal of each value, whereas the arithmetic mean is calculated by dividing the sum of all values by the number of values.

Divide 1 by the number to get the reciprocal of a number. Example the reciprocal of 4 is 1/4.

The AVERAGE function lets you calculate the arithmetic mean in Excel.

*When to calculate the harmonic mean?*

The harmonic mean is often the most useful measure for rates and ratios. It gives greater weight to smaller values in a given data set.

*How is the weighted harmonic mean calculated?*

The weighted harmonic mean is a variation of the regular harmonic mean that takes into account the relative weight of each data point. It is calculated using the following formula:

Weighted Harmonic Mean = n / Î£(w_{i} / x_{i})

Where:

n is the sum of the weights (Î£w_{i})

w_{i} is the weight associated with each data point x_{i}

x_{i} is the value of the i-th data point

The steps to calculate the weighted harmonic mean are:

- Assign a weight (w
_{i}) to each data point (x_{i}) based on their relative importance or significance. - Calculate the reciprocal of each data point (1/x
_{i}). - Multiply each reciprocal (1/x
_{i}) by its corresponding weight (w_{i}). - Sum up the weighted reciprocals from step 3: Î£(w
_{i}/ x_{i}) - Calculate the sum of the weights: Î£w
_{i} - Divide the sum of the weights (Î£w
_{i}) by the sum of the weighted reciprocals from step 4: n / Î£(w_{i}/ x_{i})

## 2. HARMEAN Function Syntax

HARMEAN(*number1*, [*number2*], ...)

## 3. HARMEAN Function Arguments

Argument |
Description |

number1 |
Required. A single numerical value or a cell reference to multiple numerical values. |

[number2] |
Optional. Up to 254 additional arguments. |

Text, logical values and empty cells are ignored.

The HARMEAN function returns

- #NUM! error value if number is less than or equal to 0 (zero).

## 4. HARMEAN Function Example 1

**A manufacturing plant produces three different types of components. The production rates (units per hour) for each type are as follows: Type A: 50, 60, 70 Type B: 45, 55, 65 Type C: 40, 50, 60 Calculate the harmonic mean of the production rates for each type of component?**

The image above shows the production rates in cell range B15:F18, the column chart shows the different production rates grouped in category A, B and C.

Formula in cell F16:

The formula in cell F16 calculates the harmonic mean based on the following production rates: 50, 60, and 70. The calculation is 3/(1/50+1/60+1/70) equals approx 58.88

The formula in cell F17 returns the harmonic mean based on these production rates: 45, 55, and 65. The calculation is 3/(1/45+1/55+1/65) equals approx 53.77

The formula in cell F18 returns the harmonic mean based on these production rates: 40, 50, and 60. The calculation is 3/(1/40+1/50+1/60) equals approx 48.65

## 5. HARMEAN Function Example 2

**A car travels at 10 mph (miles per hour) for 1 mile, 30 mph for 5 miles, and 50 mph for 2 miles. The total distance is 8 miles. What is the average speed?**

The formula for calculating the distance: Distance = Speed x Time

This gives us: Speed = Distance / Time

The total distance is 1 + 5 + 2 equals 8.

The time it takes to travel a distance is calculated like this:

Time = Distance / Speed

The harmonic weighted average is (1+5+2)/(1/10 + 5/30 + 2/50)

becomes 8/(23/75)

equals approx. 26.09 mph.

Weighted harmonic average formula in cell F4:

The formula in cell F4 returns approx. 26.09 which matches the calculated value we did above.

### Explaining formula

#### Step 1 - Add distances

The SUM function allows you to add numerical values, the function returns the sum in the cell it is entered in. The SUM function is cleverly designed to ignore text and boolean values, adding only numbers.

Function syntax: SUM(number1, [number2], ...)

SUM(C3:E3) becomes SUM({1,5,2}) and returns 8.

#### Step 2 - Divide distance with speed

The division character lets you calculate a ratio based on a numerator and denominator..

C3:E3/C4:E4 becomes {1,5,2}/{10,30,50} and returns {0.1,0.166666666666667,0.04}

#### Step 3 - Add ratios and return a total

SUM(C3:E3/C4:E4) becomes SUM({0.1,0.166666666666667,0.04} and returns 0.306666666666667

#### Step 4 - Divide total distance by total time

SUM(C3:E3)/SUM(C3:E3/C4:E4)

becomes

8/0.306666666666667

and returns 26.0869565217391

## 6. HARMEAN Function Example 3

**A manufacturing plant produces electronic components. The production rates (units per hour) are 50 units/hour while producing 275 units, 25 units/hour for 120 units, 10 units/hour for 435 units, and 40 units/hour for 10 units. What is the average production rate, in other words, calculate the weighted harmonic mean of the production rates?**

Cell range B16:C20 contains a data table with the following header names: "Production rate (units/hour)" and "Units produced".

Production rate (units/hour) |
Units produced |

50 | 275 |

25 | 120 |

10 | 435 |

40 | 10 |

Formula in cell C22:

The formula in cell C22 calculates the weighted harmonic mean based on the data in B17:C20. The result is approx. 15.54 units/hour.

### Functions in 'Statistical' category

The HARMEAN function function is one of 73 functions in the 'Statistical' category.

## How to comment

How to add a formula to your comment<code>Insert your formula here.</code>

Convert less than and larger than signsUse html character entities instead of less than and larger than signs.

< becomes < and > becomes >

How to add VBA code to your comment[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

How to add a picture to your comment:Upload picture to postimage.org or imgur

Paste image link to your comment.

Contact OscarYou can contact me through this contact form