菜单
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Excel 教程

Excel HOME Excel Introduction Excel Get Started Excel Overview Excel Syntax Excel Ranges Excel Fill Excel Move Cells Excel Add Cells Excel Delete Cells Excel Undo Redo Excel Formulas Excel Relative Reference Excel Absolute Reference Excel Arithmetic Operators Excel Parentheses Excel Functions

Excel Formatting

Excel Formatting Excel Format Painter Excel Format Colors Excel Format Fonts Excel Format Borders Excel Format Numbers Excel Format Grids Excel Format Settings

Excel Data Analysis

Excel Sort Excel Filter Excel Tables Excel Conditional Format Excel Highlight Cell Rules Excel Top Bottom Rules Excel Data Bars Excel Color Scales Excel Icon Sets Excel Manage Rules (CF) Excel Charts

Table Pivot

Table Pivot Intro

Excel Case

Case: Poke Mart Case: Poke Mart, Styling

Excel Functions

AND AVERAGE AVERAGEIF AVERAGEIFS CONCAT COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS IF IFS LEFT LOWER MAX MEDIAN MIN MODE NPV OR RAND RIGHT STDEV.P STDEV.S SUM SUMIF SUMIFS TRIM VLOOKUP XOR

Excel How To

Convert Time to Seconds Difference Between Times NPV (Net Present Value) Remove Duplicates

Excel Examples

Excel Exercises Excel Certificate

Excel References

Excel Keyboard Shortcuts


如何使用 Excel 查找两个时间点之间的差值


了解如何使用 Excel 查找两个时间点之间的差值。


Excel 可以将时间转换为秒。

数字 86400 可用于将时间转换为秒。

Conversion number 86400

请阅读 如何将时间转换为秒章节 中关于 86400 的更多内容。


如何查找两个时间点之间的差值?

步骤 1) 创建一个工作表并设置值

在此示例中,我们将查找 14:00(A2) 时间 A 和 16:00(A3) 时间 B 之间的秒数。

复制值以遵循示例。

将值直接粘贴到您的工作表中。

Time to seconds setup
复制值

信息

使用 86400 这个数字时,Excel 可能会更改格式。

如果格式更改为时间格式,请确保将其改回数字格式。


步骤 2) 将时间转换为秒

让我们将时间乘以 86400。

选择单元格 C2

时间 A 转换为秒:

计算

B2(14:00) * G1(86400) = 50400
Time to seconds

时间 B 重复相同的操作:(B3(16:00) * G1(86400))


步骤 3) 查找秒数差值

选择单元格 F9

时间 B时间 A 中减去以查找差值。

使用转换后的秒数进行计算(C 列中的数字)。

计算

C3(57600) - C2(50400) = 7200 秒
Difference between Time A and Time B

步骤 4) 将秒转换为分钟

将秒数除以 60 以查找分钟数。

选择单元格 F10

计算

F9(7200) / G2(60) = 120 分钟
Seconds converted to minutes

步骤 5) 将分钟转换为小时

将分钟数除以 60 以查找小时数。

选择单元格 F11

计算

F9(120) / G3(60) = 2 小时
Seconds converted to minutes

干得好!

您已成功找到 14:0016:00 之间的时间差。

在这种情况下,正确答案是 7200 秒,或 120 分钟,或 2 小时


×

联系销售

如果您想将 W3Schools 服务用于教育机构、团队或企业,请发送电子邮件给我们
sales@w3schools.com

报告错误

如果您想报告错误,或想提出建议,请发送电子邮件给我们
help@w3schools.com

W3Schools 经过优化,旨在方便学习和培训。示例可能经过简化,以提高阅读和学习体验。教程、参考资料和示例会不断审查,以避免错误,但我们无法保证所有内容的完全正确性。使用 W3Schools 即表示您已阅读并接受我们的使用条款Cookie 和隐私政策

版权所有 1999-2024 Refsnes Data。保留所有权利。W3Schools 由 W3.CSS 提供支持