跳到主要内容

如何计算两次或两次之间的时差?

如果您有两个时间列表,例如A列和B列(A列中的时间早于同一行中的B列),如下面的屏幕截图所示,您将无法获得正确的时间,而将后面的时间减去早期的。 因此,现在,我讨论在Excel中计算时差的方法。


箭头蓝色右气泡 在Excel中计算两次之间的时差

在我们的例子中,我们假设两列中只有小时,分钟和秒,并且同一行中A列的时间总是早于B列。

1.选择一个空白单元格,在这种情况下,我选择“单元格C2”,键入以下公式 = B2-A2 +(A2> B2) (单元格A2中的时间早于单元格B2,您可以根据需要进行更改),按 输入 键,然后拖动填充手柄以填充应用此公式所需的范围。 看截图:

2.选择结果范围,在这种情况下,选择结果范围C2:C6,然后右键单击> 格式化单元格 在上下文菜单中。 看截图:

3.在 单元格格式 对话框中,单击 联系电话 标签> 时间,然后从右侧部分中选择所需的时间格式,然后点击 OK。 看截图:

然后您可以看到时间差已计算如下:


箭头蓝色右气泡 在Excel中计算两个日期之间的时差

如果列中不仅有小时,分钟和秒,而且还有日期,则可以执行以下操作:

1.选择一个空白单元格,在这种情况下,我选择“单元格C2”,键入以下公式 = B2-A2 (单元格A2中的时间早于单元格B2,您可以根据需要进行更改),按 输入 键,然后拖动填充手柄以填充应用此公式所需的范围。 看截图:

2.选择结果范围,在这种情况下,选择范围C2:C6,然后右键单击> 格式化单元格 在上下文菜单中。 看截图:

3.在 单元格格式 对话框中,单击 联系电话 标签> 时间,然后选择 37:30:55 来自 Type 部分,点击 OK。 看截图:

然后您可以看到时间差已计算如下:


箭头蓝色右气泡 使用 Kutools for Excel 计算两个日期之间的时间差

如果要计算时差并将计算出的时差显示为单词(3小时5毫秒12秒),则可以使用 日期和时间助手 实用程序 Kutools for Excel.

Kutools for Excel, 与超过 300 方便的功能,使您的工作更加轻松。 

免费安装 Kutools for Excel,请执行以下操作:

1.选择一个将放置时差的单元格,单击 库工具 > 公式助手 > 日期和时间助手,请参见屏幕截图:
doc时差kte 1

2.在弹出的对话框中,选中 区别 复选框,然后选择两次 参数输入 文本框,在下拉列表中根据需要选择一种显示类型 输出结果类型,请参阅screeshot:
doc kutools日期时间助手2

3.单击确定,然后显示第一个结果,将自动填充手柄拖到单元格上以计算所有时间差。
doc kutools日期时间助手3 doc kutools日期时间助手4


相关文章:

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (21)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
how to calculate difference for the below scenario


4/8/2019 10:18:22 AM

4/8/2019 6:10:01 PM

please help me..
This comment was minimized by the moderator on the site
Hi, prasad nalliri, just use one date to minus another date, then format the result (a number string) as a date or time format as you need:
A1 4/8/2019 10:18:22 AM

A2 4/8/2019 6:10:01 PM
Using this formula in B1: ==ABS(A1-A2)
Result: 0.327534722
Format the result as time or date
This comment was minimized by the moderator on the site
Hi there, I know how to calculate the difference between a start and finish time. However, I would like to know what is the formula when I also want to minus a target date Is there such a formula?



example: start date: 10/29/17 12:00 AM

A. 1st transaction date: 10/28/17 03:22 PM
B. end of 1st transaction date: 10/30/17 01:13 PM


if Column A is not equal to 10/29/17 12:00am then excess hours should be subtracted from the accumulated hrs from A and B
This comment was minimized by the moderator on the site
Sorry, Could you give a compliacted instance? Through your description, I do not understand clearly.
This comment was minimized by the moderator on the site
Hi there, I know how to calculate the difference between a start and finish time. However, I would like to know what the formula is when I also want to minus 30minutes. Is there such a formula?
This comment was minimized by the moderator on the site
Thanks for your leaving massage, you can try this formula =A1-TIME(0,30,0). See screenshot:
This comment was minimized by the moderator on the site
Hi team, i want to caluculate the time difference in the same cell ans the working hours should be come in next colum for example under timings 9:00am-06:00pm is there i want to know the working time in hours for example like 8 hrs or 9 hours like that. Sample: Timings Hours 09:15 AM - 06:15 PM
This comment was minimized by the moderator on the site
I want to highlight the late comers time by getting the difference of exceed time(late time) with the actual time For ex: if the actual time is 8.00AM if anyone comes by 8.30AM ,the time difference be 0.30minutes .. How can i highlight that 30 minutes using conditional formating in excel? or is there any options to highlight that?
This comment was minimized by the moderator on the site
I am having A1 cell : 04/14/2016 11:15:43 and B2 cell : 03/31/2016 10:41:23 Please let me know the time duration in hrs of between two difference date. exmple refno reg_code status cpv_incoming_date CPV Out CPV Out Time WH CPV IN WH CPV IN time Range CPV In Time ABC A B 09-MAY-2016,14:00:50 10-May-16 16:06:59 10-May-16 9:30:00 >6 hrs and < 8 Hrs 9-May-16 14:00:50
This comment was minimized by the moderator on the site
I am having A1 cell : 04/14/2016 11:15:43 AM and B2 cell : 03/31/2016 10:41:23 AM. Please let me know the time duration in minutes of between two difference date.
This comment was minimized by the moderator on the site
Scenario, Compare the h:mm:ss from the column A1 and display if the value in A2 cell is greater that 15 minutes then display the timing in proper column data condition There is a value in a cell A2, 0:16:38(h:mm:ss) and column B name "
This comment was minimized by the moderator on the site
ENTER EXIT TURN OVER 825 847 913 939 26 1038 1109 59 1133 1153 24 Please can you help me find a formulate to calculate turnover. The difference between Exit to Enter. Thanks.
This comment was minimized by the moderator on the site
Please advise how to convert time result 7.30 to 7.5 hours. Example result shows 7.30 hours different between two that should be total hours 7.5 in the time sheet.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations