2楼
=IF(AND(ROUNDUP(B1,3)=B1,RIGHT(FIXED(B1,3))="5",MOD(RIGHT(FIXED(B1,2)),2)),ROUNDDOWN(B1,2),ROUND(B1,2))
用这个公式也可以轻松搞定,,保留两位小数的
回复
3楼
我做了个函数,可以任意间隔修约,函数名成Myround,两个参数一个修约数RoundNumber,另一个修约间隔RoundSpace
Public Function Myround(RoundNumber, RoundSpace As Single) As Double
Dim p As Single, q As Integer
p = (RoundNumber / RoundSpace) - Int(RoundNumber / RoundSpace)
q = Int(RoundNumber / RoundSpace) Mod 2
If p < 0.5 Then
Myround = Int(RoundNumber / RoundSpace) * RoundSpace
ElseIf p > 0.5 Then
Myround = Int(RoundNumber / RoundSpace + 1) * RoundSpace
Else
If q = 0 Then
Myround = Int(RoundNumber / RoundSpace) * RoundSpace
Else
Myround = Int(RoundNumber / RoundSpace + 1) * RoundSpace
End If
End If
End Function
回复