選單
×
   ❮   
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 提供支援