=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)))
完全符合
=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为原始数据
设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测试通过
=MROUND(A1,0.5)
此函数在2007以下版本可直接使用,在Excel2003中需要加载宏方可实现
=INT(A1)+LOOKUP(MOD(A1,1),{0,0.25,0.75},{0,0.5,1})