excel函数精确取舍,0到0.5之间大于0.25取舍为0.5小于0.25归零;0.5到1之间大于0.75取舍为整数,小于0.75

2024-12-26 21:59:14
推荐回答(5个)
回答1:

=IF(A1-INT(A1)<0.25,INT(A1),IF(A1-INT(A1)<0.5,INT(A1)+0.5,IF(A1-INT(A1)<0.75,INT(A1)+0.5,INT(A1)+1)))

完全符合

回答2:

=IF(A1-INT(A1)<0.25,INT(A1),IF(A1-INT(A1)<0.5,INT(A1)+0.25,IF(A1-INT(A1)<0.75,INT(A1)+0.5,INT(A1)+1)))

A1为原始数据

回答3:

设C2为值,在D2输入
=IF(AND(C102>=0,C102<=0.25),0,IF(AND(C102>0.25,C102<=0.5),0.5,IF(AND(C102>0.5,C102<=0.75),0.75,IF(AND(C102>0.75,C102<=1),1,"超出范围"))))

Excel2003测试通过

回答4:

=MROUND(A1,0.5)

此函数在2007以下版本可直接使用,在Excel2003中需要加载宏方可实现

回答5:

=INT(A1)+LOOKUP(MOD(A1,1),{0,0.25,0.75},{0,0.5,1})