excel ,时间公式? 100
选择J列,分列,分隔符号,下一步,勾选 空格,完成。
在N2中输入或复制粘贴下列公式
=SUM(IFERROR(IF(RIGHT(J2:L2,5)-LEFT(J2:L2,5)>=0,RIGHT(J2:L2,5)-LEFT(J2:L2,5),MOD(RIGHT(J2:L2,5)-LEFT(J2:L2,5),1)),0))
或
=SUM(IFERROR(IF(RIGHT(J2:L2,5)-LEFT(J2:L2,5)>=0,RIGHT(J2:L2,5)-LEFT(J2:L2,5),MOD(RIGHT(J2:L2,5)-LEFT(J2:L2,5),1)),0))*24
下拉填充
将单元格区域设置为短时间格式,如果合计超过24小时,需要自定义时间格式[HH]:MM。
K2单元格输入公式=TEXT(SUM(IFERROR(MOD(TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(J2,"-"," "),"次日",)," ",REPT(" ",100)),(2*ROW($1:$50))*100-99,100))-TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(J2,"-"," "),"次日",)," ",REPT(" ",100)),(2*ROW($1:$50)-1)*100-99,100)),1),0)),"h小时m分钟")
数组公式, Ctrl+Shift+回车,公式两端出现大括号{}后,下拉公式。 如图: