# VHARMEAN function

## Description

VHARMEAN(variable[,filter]) returns the harmonic mean of a variable. An optional filter can be specified.

The harmonic mean is calculated as follows:

$$\frac{n}{\frac1{x_1} + \frac1{x_2} + \cdots + \frac1{x_n}} = \frac{n}{\sum\limits_{i=1}^n \frac1{x_i}} $$

The harmonic mean is undefined for a data set that contains zero or negative values.

## Note

This function calculates a statistic on a variable. Be careful when you use this function in cells of the columns that correspond to the variable, because this actually adds a value to the variable which can lead to unexpected and faulty results. You can exclude the cell to avoid this.