Differences between string representations of date/times

前端 未结 2 1057
情深已故
情深已故 2021-01-29 12:28

In Excel 2007, I want the differences for the following string date/times:

  A                         B                          C
1 Date1                              


        
2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-29 12:56

    A rather long-winded way to calculate zero (for the examples):

    =SUBSTITUTE(LEFT(A2,10),".","/")+MID(A2,12,8)+RIGHT(A2,4)/86400000-(SUBSTITUTE(LEFT(B2,10),".","/")+MID(B2,12,8)+RIGHT(B2,4)/86400000)  
    

    By special request and very slightly shorter:

    =SUBSTITUTE(LEFT(A2,10),".","/")+REPLACE(RIGHT(A2,13),9,1,".")-(SUBSTITUTE(LEFT(B2,10),".","/")+REPLACE(RIGHT(B2,13),9,1,"."))
    

提交回复
热议问题