请问excel有公式如果两个数相减的差在-1和1之间就返回0么?

l
luluyoga
楼主 (北美华人网)
如题
a
aegeanboat
没有。但是你可以用IF 和 ABS 组合。
a
azurepiggy~2代
IF?
p
pinwheel
IF(ABS(A1-B1)<1,0,1) returns 0 if A1-B1 is between -1 and 1, and returns 1 otherwise. (Sorry my computer doesn't have Chinese input.)
l
luluyoga
楼上abs公式的那个返回值为1,不是0
p
pinwheel
回复 5楼luluyoga的帖子
The formula only gives 0 if |A1-B1|<1 (not including the cases when A1-B1=-1 or 1).
If you want to include -1 and 1, then you can use IF(ABS(A1-B1)<=1,0,1). It will return 0 if |A1-B1|<=1.
f
faint_u
除以二取整
l
longbows
=INT(ABS(cellA-cellB))