凑个热闹吧,公式巨长:831字符
C2=IF((IF(ISERROR(FIND("天",A2)),,LEFT(A2,FIND("天",A2)-1))-IF(ISERROR(FIND("天",B2)),,LEFT(B2,FIND("天",B2)-1)))*24+IF(ISERROR(FIND("小时",A2)),,LOOKUP(99,--RIGHT(SUBSTITUTE(A2,"小时",),{1,2})))-IF(ISERROR(FIND("小时",B2)),,LOOKUP(99,--RIGHT(SUBSTITUTE(B2,"小时",),{1,2})))>0,TEXT(INT(((IF(ISERROR(FIND("天",A2)),,LEFT(A2,FIND("天",A2)-1))-IF(ISERROR(FIND("天",B2)),,LEFT(B2,FIND("天",B2)-1)))*24+IF(ISERROR(FIND("小时",A2)),,LOOKUP(99,--RIGHT(SUBSTITUTE(A2,"小时",),{1,2})))-IF(ISERROR(FIND("小时",B2)),,LOOKUP(99,--RIGHT(SUBSTITUTE(B2,"小时",),{1,2}))))/24),"[>0]#天;")&TEXT(MOD((IF(ISERROR(FIND("天",A2)),,LEFT(A2,FIND("天",A2)-1))-IF(ISERROR(FIND("天",B2)),,LEFT(B2,FIND("天",B2)-1)))*24+IF(ISERROR(FIND("小时",A2)),,LOOKUP(99,--RIGHT(SUBSTITUTE(A2,"小时",),{1,2})))-IF(ISERROR(FIND("小时",B2)),,LOOKUP(99,--RIGHT(SUBSTITUTE(B2,"小时",),{1,2}))),24),"[>0]#小时;"),"")
下拉
[ 本帖最后由 MicrosoftEH 于 2010-9-26 10:19 编辑 ] |