|
我不太懂excel
你试试陈峰这个 函数
------------------计算总体参数为n-1的标准差---------------
'--输 入:Expr-1[, Expr-2, ... [, Expr-n]]
'--输 出:计算总体参数为n-1的标准差
'--作 者:陈峰
'---------------------------------------------------
Function Stdev(ParamArray Expr() As Variant) As String
Dim curSun As Double, curAverageBad As Double, curBadSquare As Double
Dim curAccuracy As Double
Dim ExprLen As Long
ExprLen = UBound(Expr) + 1
curAccuracy = Val("10000000000000000")
For i = 0 To ExprLen - 1
curSun = curSun + Val(Expr(i))
Next
curAverageBad = Fix(curSun / ExprLen)
For i = 0 To ExprLen - 1
curBadSquare = curBadSquare + (Val(Expr(i)) - curAverageBad) ^ 2
Next
If ExprLen <= 20 Then
Stdev = Fix(100 * Sqr(curBadSquare / (ExprLen - 1)) * curAccuracy + 0.5) / curAccuracy / 100
Else
Stdev = Fix(100 * Sqr(curBadSquare / ExprLen) * curAccuracy + 0.5) / curAccuracy / 100
End If
End Function
'*************************************************************************
|
|