跳到主要內容

如何在Excel中快速將時間轉換為文本或小時/分鐘/秒數?

在本教程中,我將介紹在Excel中將時間轉換為文本字符串或數字字符串或十進制小時數,分鐘數和秒數的方法。

將時間轉換為文本字符串

將時間轉換為數字字符串

將時間轉換為小時/分鐘/秒


將時間轉換為文本字符串

這是一個可以將時間轉換為文本字符串的公式。

選擇將放置文本結果的單元格,鍵入此公式 =TEXT(A1,"hh:mm:ss AM/PM"), 按 Enter 鍵。 並且,如果需要,向下拖動填充手柄以將該公式應用於以下單元格。

doc到文本編號1的時間
doc到文本編號2的時間

將時間轉換為數字字符串

要將時間轉換為數字字符串,您只需要將時間單元格設置為常規。

選擇要轉換的時間單元,單擊 首頁 標籤,轉到 聯繫電話 組,選擇 從下拉列表中。
doc到文本編號3的時間


將時間轉換為小時/分鐘/秒

如果要將時間轉換為小時/分鐘/秒,可以選擇以下方法之一進行處理。

使用公式將時間轉換為小時/分鐘/秒

Time 公式 結果
16:15:48      = A1 * 24 16.26
16:15:48 = A1 * 1440 975.8
16:15:48 = A1 * 86400      58548      

切記將結果單元格設置為常規格式。

使用Kutools for Excel將時間轉換為小時/分鐘/秒

Excel的Kutools, 與以上 300 方便的功能,使您的工作更加輕鬆。 

安裝後 Kutools for Excel,請執行以下操作:(立即免費下載Kutools for Excel!)

選擇要轉換的單元格,單擊 庫工具 > Content > Convert Time > Time to Hours/Time to Minutes/Time to Seconds.
doc到文本編號4的時間

然後時間將被轉換。
doc到文本編號5的時間

尖端:如果要將轉換後的結果放置在其他位置,可以單擊 庫工具 > Content > Convert Time > Convert Time to enable Convert Time 對話框,選擇轉換類型,檢查 Save to another location 複選框,然後選擇一個單元格以放置結果。
doc到文本編號6的時間


在Excel中快速輕鬆地將日期轉換為其他日期格式

您是否曾經嘗試過將日期僅轉換為日,月或年? 這些公式可能很難記住,但是 套用日期格式 of Excel的Kutools 可以根據需要將標準日期快速轉換為日期格式,如下圖所示。 不要,服務員, 點擊取得30天免費試用!
doc申請日期格式
 
Kutools for Excel:擁有300多個便捷的Excel加載項,可以在30天內免費試用。

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (11)
Rated 4.25 out of 5 · 2 ratings
This comment was minimized by the moderator on the site
in the description is the wrong formula...
It is NOT: =TEXT(A1,"hh:mm:ss AM/PM")
It is: =TEXT(A1; "hh:mm:ss AM/PM")

with a semicolon, not a comma!
Rated 3.5 out of 5
This comment was minimized by the moderator on the site
I want to substitute time in the string, but whenever i use the formula the time converts into timevalue, i dont want time value. Can you please teach me what to do?[img]https://ibb.co/NVvknsF[/img]
This comment was minimized by the moderator on the site
Hi, Md. Shariful Islam, add TEXT function to fix the time format in the formula, the result will keep the time format but not the value.
=SUBSTITUTE(A1,MID(A1,13,8),TEXT(F1,"hh:mm:ss"))
See the screenshot:
https://www.extendoffice.com/images/stories/comments/sun-comment/doc-substitute-time.png
This comment was minimized by the moderator on the site
Hi have a excel roster with time formulas to calculate the total hours for the week for each employee.

My question is on the days that staff member is OFF / Public Hol / Annual leave etc.
Wanting to enter words instead of time when someone is off or sick or on annual leave of if Pub Hol but when time in the words it messes up the time calculation giving a value error.

How do i enter words in a time cell without messing up the calculations.
This comment was minimized by the moderator on the site
Hi, could you upload a file or a screenshot to show what's your data structure like for me to better find a solution?
This comment was minimized by the moderator on the site
¡Excelente ! Gracias
Rated 5 out of 5
This comment was minimized by the moderator on the site
Thank You! I've been looking for a way to do this all day!
This comment was minimized by the moderator on the site
These formulas are super helpful, thank you. I find that I have a question about your Convert Time To Text String formula.I am using it to retain the hh:mm formatting in Excel into a Word doc via a mail merge.
This comment was minimized by the moderator on the site
Hiunable to get the formula in the excel
This comment was minimized by the moderator on the site
really helpful, thx!
This comment was minimized by the moderator on the site
Perfect. Thank you!!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations