在excel上计算两个日期和时间的差异

时间:2021-05-21 21:31:57

I want to calculate the difference between two dates and time and the result should be on "hh:mm:ss"

我想计算两个日期和时间的差值,结果应该是“hh:mm:ss”

   |           E          |           F         |    G     |
===+======================+=====================+==========+
3  | 01/01/2013  13:34:50 | 31/01/2013  7:34:05 | 17:59:15 |

I tried this =TEXT(F3-E3;"hh:mm:ss") but it only count the difference from times, not date. I also tried to add dd like this: =TEXT(F3-E3;"dd hh:mm:ss") It works, but that's not the result I'm looking for.

我试过这个=TEXT(F3-E3;“hh:mm:ss”),但它只计算时间的不同,不计算日期。我还尝试添加dd: =TEXT(F3-E3;它起作用,但那不是我想要的结果。

2 个解决方案

#1


8  

I think this is what you want:

我想这就是你想要的:

=TEXT(F3-E3;"[h]:mm:ss")

#2


0  

I think the semicolon should be replaced with a comma:

我认为分号应该用逗号代替:

=TEXT(E5-D5,"[h]:mm:ss")

#1


8  

I think this is what you want:

我想这就是你想要的:

=TEXT(F3-E3;"[h]:mm:ss")

#2


0  

I think the semicolon should be replaced with a comma:

我认为分号应该用逗号代替:

=TEXT(E5-D5,"[h]:mm:ss")