Function Math Statistics Class

HarmonicMean

Harmonic mean of numeric arguments.

Signature (Visual Basic / VBA)

Public Function HarmonicMean( _
    ParamArray vValues() As Variant _
    ) As Variant

Code Example

    HarmonicMean(12, 34, 56) = 22.970509383378
    HarmonicMean(SampleData) = 141.369758088961

Parameters

Parameter Description
vValues The values that are to be averaged. Can be numbers, one-dimensional numeric arrays, one-dimensional Variant arrays, one-dimensional Variant arrays with embedded arrays, or any combination of these. The current setting of the StatVarType Property determines which numeric data types are recognized by this function.

Return Value

Function returns the harmonic mean of the numeric values. Function returns Null if none of the arguments are numeric.