Formualizer Docs

HARMEAN

Returns the harmonic mean of positive numeric values.

HARMEAN emphasizes smaller values and is useful for averaging rates and ratios.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

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

Arguments

ArgumentTypeRequiredDefault
number1number (range)Required—
number2number (range)Optional—

Accepts a variable number of arguments. Minimum: 1.

Remarks

  • All numeric inputs must be strictly greater than 0.
  • Non-numeric values in referenced ranges are ignored.

Error cases

  • Returns #NUM! if any value is <= 0, or if no numeric values are provided.

Examples

Find the harmonic mean of 4, 8 and 12.

Formula =HARMEAN(4,8,12)

Expected result 6.54545454545455

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Pass one three-element array to compute the harmonic mean.

Formula =HARMEAN({4,8,12})

Expected result 6.54545454545455

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Taking the reciprocal twice returns the sole harmonic-mean input.

Formula =HARMEAN(7)

Expected result 7

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A division error among 4 and 12 prevents computing the harmonic mean.

Formula =HARMEAN(4,1/0,12)

Expected result #DIV/0!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Harmonic mean from scalar values

Formula =HARMEAN(1,2,4)

Expected result 1.71428571428571

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Harmonic mean from a range

Formula =HARMEAN(A1:A3)

Input cells
A
12
23
36

Expected result 3

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

Why does HARMEAN fail on zeros?

Harmonic mean uses reciprocals, so inputs must be strictly positive.

Implementation

Engine source

On this page