我写了个公式,算是能满足要求,有可能不是最简单的,首先将时间转化成
=HOUR(C8)+IF(MINUTE(C8)>=30,0.5,0)-(HOUR(C7)+1-IF(MINUTE(C7)<=30,0.5,0))+HOUR(C6)+IF(MINUTE(C6)>=30,0.5,0)-(HOUR(C5)+1-IF(MINUTE(C5)<=30,0.5,0))
最后结果设置成常规。
B9公式:
=FLOOR(B4,1/48)-CEILING(B3,1/48)+FLOOR(B6,1/48)-CEILING(B5,1/48)
=(FLOOR(B4-MAX(B3,"8:00"),"0:30")+FLOOR(B6-B5,"0:30")+FLOOR(B8-B7,"0:30"))*24