Averages/Pythagorean means: Difference between revisions
Content added Content deleted
(→{{header|VBA}}: excel has a built-in harmonic mean ...) |
(→{{header|VBA}}: Excel has also built-in average and geometric mean) |
||
Line 3,260: | Line 3,260: | ||
Uses Excel VBA. |
Uses Excel VBA. |
||
<lang vb>Private Function arithmetic_mean(s() As Variant) As Double |
<lang vb>Private Function arithmetic_mean(s() As Variant) As Double |
||
arithmetic_mean = WorksheetFunction. |
arithmetic_mean = WorksheetFunction.Average(s) |
||
End Function |
End Function |
||
Private Function geometric_mean(s() As Variant) As Double |
Private Function geometric_mean(s() As Variant) As Double |
||
geometric_mean = WorksheetFunction. |
geometric_mean = WorksheetFunction.GeoMean(s) |
||
WorksheetFunction.Product(s), 1 / UBound(s)) |
|||
End Function |
End Function |
||
Private Function harmonic_mean(s() As Variant) As Double |
Private Function harmonic_mean(s() As Variant) As Double |