如何计算Excel中两个单元格之间的时差

时间:2021-05-21 21:32:03

I've time value in two columns in my sheet. Ex: Col A & B
In col C i want the time difference between time in A & B

我在工作表中的两列中有时间价值。例如:Col A&B在col C中我想要A和B中的时间之间的时差

Example :
如何计算Excel中两个单元格之间的时差

But it is giving me seconds difference.
I've tried the formula =INT((B2-A2)*24) but i got hours alone.

但它给了我几秒钟的差异。我已经尝试了公式= INT((B2-A2)* 24)但我只有几个小时。

My expected result is how many hours,min,seconds differed01:20:52 in two cells.

我的预期结果是两个单元格中的小时数,分钟数,秒数相差01:20:52。

How to get that?

怎么做到的?

1 个解决方案

#1


Set the cell formula as =b2-a2 (ie. the smaller should be subtracted from the larger, not vice versa) and format the cell as Time or [h]:mm:ss

将单元格公式设置为= b2-a2(即,应从较大值中减去较小值,反之亦然)并将单元格格式化为时间或[h]:mm:ss

#1


Set the cell formula as =b2-a2 (ie. the smaller should be subtracted from the larger, not vice versa) and format the cell as Time or [h]:mm:ss

将单元格公式设置为= b2-a2(即,应从较大值中减去较小值,反之亦然)并将单元格格式化为时间或[h]:mm:ss