Averages/Pythagorean means: Difference between revisions

→‎{{header|VBA}}: Excel has also built-in average and geometric mean
(→‎{{header|VBA}}: excel has a built-in harmonic mean ...)
(→‎{{header|VBA}}: Excel has also built-in average and geometric mean)
Line 3,260:
Uses Excel VBA.
<lang vb>Private Function arithmetic_mean(s() As Variant) As Double
arithmetic_mean = WorksheetFunction.sum(s) / UBoundAverage(s)
End Function
Private Function geometric_mean(s() As Variant) As Double
geometric_mean = WorksheetFunction.PowerGeoMean( _s)
WorksheetFunction.Product(s), 1 / UBound(s))
End Function
Private Function harmonic_mean(s() As Variant) As Double
255

edits