Private Function median(lstBox As Control)

If lstBox.ListCount Mod 2 = 1 Then

lstBox.ListIndex = (lstBox.ListCount / 2) - 0.5

median = lstBox.Text

Exit Function

Else

lstBox.ListIndex = (lstBox.ListCount / 2) - 1

sum = Val(lstBox.Text)

lstBox.ListIndex = lstBox.ListIndex + 1

sum = sum + Val(lstBox.Text)

median = sum / 2

End If

End Function

Private Function mean(lstBox As Control)

Dim sum As Long

For i = 0 To lstBox.ListCount - 1

lstBox.ListIndex = i

sum = sum + Val(lstBox.Text)

Next

mean = sum / i

End Function

'Call it a-la

myMean = mean(List1)