Excel - HARMEAN Function



HARMEAN Function

The Excel HARMEAN function is a prominent statistical function to evaluate the harmonic mean of a data set. This function works efficiently for the positive numeric data, date, and time and generates an accurate output as compared arithmetic average function. It is used in wide areas like Mechanical and Electrical engineering, computing the average speed, average reciprocals, and, financial modeling.

The relationship between the harmonic mean(H), geometric mean(G), and arithmetic mean(A) is H < G < A.

Compatibility

This advanced Excel function is compatible with the following versions of MS Excel −

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2024
  • Excel 2024 for Mac
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2016
  • Excel 2013
  • Excel 2010
  • Excel 2007

Syntax

The syntax of the HARMEAN function is as follows −

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

Arguments

You can use the following arguments with the HARMEAN function −

Argument Description Required/ Optional
Number1 It specifies the 1 to 255 arguments where the harmonic mean is to be retrieved. Required
number2, ... It may contain a single array or cell references that point to the numeric value. Optional

Points to Remember

  • The mathematical notation for harmonic mean is −

$$\mathrm{\frac{1}{H_y}\:=\:\frac{1}{n}\:\sum \frac{1}{Y_j}}$$

  • Arguments can either be numbers or names, arrays, or references that refer to numbers.
  • Boolean values and numbers's text depiction written directly into the arguments list are counted.
  • If the reference argument or array specifies Boolean values, text values, or blank cells, these values are not included whereas the cell references point to zero are counted.
  • If any data points cannot be transformed into numeric values, the HARMEAN function returns the #VALUE! error.
  • If any data points contain a negative value, the HARMEAN function retrieves the #NUM! error.

Examples of HARMEAN Function

Practice the following examples to learn the use of the HARMEAN function in Excel.

Example 1: How to Calculate the Harmonic Average in Excel?

In this example, we will demonstrate the HARMONIC function to get the harmonic average in the given set of numeric data.

Solution

Step 1 − First, the set of positive numbers is depicted in the cell range C2:C8. You may write the formula =HARMEAN(C2:C8) in the C9 cell and press the Enter key.

HARMEAN Function1

Therefore, the HARMEAN function returns the 25.73479 as a result.

HARMEAN Function2

Example 2

If any data points cannot be transformed into numeric values, the HARMEAN function returns the #VALUE! error.

Solution

First, switch to Sheet2, write the formula =HARMEAN(23,34,"er") in the C2 cell, and press the Enter tab. Here, in this expression, the third argument is the text "er" that cannot be interpreted as a number.

HARMEAN Function3

Hence, the resulting value is #VALUE!.

HARMEAN Function4

Example 3

If any data points contain a negative value, the HARMEAN function retrieves the #NUM! error.

Solution

You may write the formula =HARMEAN(23,34,45,-2) in the C3 cell and press the Enter tab. In this expression, the fourth argument is negative.

HARMEAN Function5

Therefore, the HARMEAN function retrieves the #NUM! error.

HARMEAN Function6

Download Practice Sheet

You can download and use the sample data sheet to practice the HARMEAN function.

Advertisements