公式:
IF(OR($A1="",$B1=""),"",SUM(HOUR(SUM($B1,-$A1)),MINUTE(SUM($B1,-$A1))/60))
举例:
举例说明:起始时间为07:30,终止时间为18:00,
假设A1=07:30 B1 = 18:00 结果要储存在C1中:
那么,C1内容为:
=IF(OR($A1="",$B1=""),"",SUM(HOUR(SUM($B1,-$A1)),MINUTE(SUM($B1,-$A1))/60))=10.5
C2公式为:=IF(AND(HOUR(A2)<12,HOUR(B2)>12),(B2-A2)*1440-60,(B2-A2)*1440)