0

=IF(I44<"0:01","0",IF(I44<"0:30","2:00",IF(I44<"1:00","2:30",IF(I44 <"1:30","3:00",IF(I44<"2:00","3:30",IF(I44<"2:30","4:00",IF(I44<" 3:00","4:30",IF(I44<"3:30","5:00",IF(I44<"4:00","5:30",IF(I44<"4: 30","6:00",IF(I44<"5:00","6:30",IF(I44<"5:30","7:00",IF(I44<"6:00" ,"7:30",IF(I44<"6:30","8:00",IF(I44<"7:00","8:30",IF(I44<"7:30"," 9:00",IF(I44<"8:00","9:30",IF(I44<"8:30","10:00",IF(I44<"9:00","10: 30",IF(I44<"9:30","11:00",IF(I44<"10:00","11:30","")))))))))))))))))))))

(省略代码标签,因此您不必向右滚动 30 页)

我正在使用此功能将特定时间量添加到特定时间范围,这似乎必须有更好的方法来执行此操作。

例如:对于 < 30 分钟的输入时间,将输出 2:00 小时,对于 < 1:00 的输入时间将输出 2:30 ... 输入中每增加 30 分钟,输出将增加 30分钟

4

1 回答 1

2

也许只是四舍五入到下一个半小时,然后再加上 2 小时,即

=IF(I44=0,0,FLOOR(I44,"0:30")+"2:00")

[用 IF 处理零值]

将结果单元格格式化为时间值,例如 h:mm 或类似的

于 2013-07-30T17:25:02.640 回答