|
Function PJ(rng) '平均值
On Error Resume Next
Application.Volatile
For Each cel In rng
If cel.EntireColumn.Hidden = False Then
s = s + cel.Value
s2 = s2 + 1
End If
Next
PJ = Application.Round(s / s2, 2)
End Function
Function ZDZ(rng) '取最大值
Application.Volatile
s = -10 ^ 8 '定义一个最小值
For Each cel In rng
If cel.EntireColumn.Hidden = False Then
If cel.Value > s Then s = cel.Value
End If
Next
ZDZ = IIf(s = -10 ^ 8, "", s)
End Function
Function ZXZ(rng) '取最小值
Application.Volatile
s = 10 ^ 9 '定义一个最大值
For Each cel In rng
If cel.EntireColumn.Hidden = False Then
If cel.Value < s Then s = cel.Value
End If
Next
ZXZ = IIf(s = 10 ^ 9, "", s)
End Function
|
评分
-
查看全部评分
|