跳到主要內容

在Excel 中處理日期時間資料時,您可能會遇到諸如“1/24/2024 14:30:00”之類的日期時間值,並且您可能需要僅提取日期“1/24/2024”而不包含時間部分。本文將向您介紹四種從時間戳記中刪除時間的簡單方法。這些方法簡單易懂,適用於各種情況,無論您是初學者還是經驗豐富的 Excel 用戶,都可以快速學習和應用。

透過更改格式隱藏日期中的時間

使用智慧型功能從日期中刪除時間

使用公式從日期中刪除時間

使用尋找和取代功能從日期中刪除時間


透過更改格式隱藏日期中的時間

  1. 選擇要刪除時間的儲存格,然後右鍵單擊,在上下文選單中選擇 單元格格式 打開 單元格格式 對話框。 看截圖:
    尖端: 也可以使用快捷方式 Ctrl+1 打開 單元格格式 對話框。

  2. 單元格格式 對話框,在“數字”選項卡下:
    1)。 選擇 日期 來自 類別 清單;
    2)。根據需要從日期類型中選擇一種 類別 列錶框;
    3)。最後,點擊 OK 按鈕。
  3. 現在,所選儲存格的格式設定為僅顯示日期,並刪除了時間。看截圖:
備註:此方法只是隱藏了時間部分,並沒有真正將其刪除,日期和時間仍然可以在公式列中看到。此外,如果在任何計算中使用這些儲存格,則這些值將包括日期和時間。

使用智慧型功能從日期中刪除時間

如果你想從時間戳記中完全刪除時間, Excel的Kutools 提供了一個智慧功能—— 從日期中刪除時間,使用此功能,您只需單擊幾下即可直接從日期時間單元格中刪除時間。

備註: 如果你想用這個 從日期中刪除時間 功能,請 下載並安裝 Kutools for Excel 第一。

安裝後 Excel的Kutools,請這樣做:

  1. 按一下以選取要放置結果的儲存格,然後按一下 庫工具 > 公式助手 > 公式助手.
  2. 公式助手 對話框中,單擊 從日期中刪除時間 ,在 選擇一個公式 部分。
  3. 然後去 參數輸入 部分,選擇要從中刪除時間的儲存格。
  4. 最後點擊 OK 按鈕。

結果:

現在,時間已從日期時間中刪除,然後將填充手柄拖曳到要根據需要應用此公式的儲存格上,請參閱下面的示範:

小提示: 要應用此功能,請 下載並安裝 Kutools for Excel 第一。

使用公式從日期中刪除時間

在 Excel 中,有一些簡單的公式可用於消除時間戳記中的時間,從而允許您僅提取日期部分。

使用 INT 函數僅提取日期

  1. 請將下列公式輸入或複製到要放置結果的儲存格中。然後,向下拖曳填滿手把將此公式填入其餘儲存格中,您將在結果中獲得帶有時間部分的日期(00:00:00),請參閱螢幕截圖:
    =INT(A2)
  2. 若要不顯示時間部分,仍保持結果選擇,然後按一下 首頁 > > 短期約會。現在,結果僅顯示為日期。看截圖:

使用 DATE 函數僅提取日期

若要僅提取日期部分,您也可以使用 DATE 函數。

通用語法:

=日期(年(日期時間),月(日期時間),日(日期時間))
約會時間:該單元格包含您僅要提取日期的日期時間。

請將下列公式輸入或複製到要放置結果的儲存格中。然後,向下拖曳填滿手柄以將此公式填入其餘儲存格中,所有日期已從沒有時間的日期時間儲存格中提取。看截圖:

=DATE(YEAR(A2),MONTH(A2),DAY(A2))


使用尋找和取代功能從日期中刪除時間

請依照以下步驟使用 Excel 從日期中刪除時間 查找和替換 功能:

  1. 選擇您要刪除時間的日期範圍。
  2. 媒體推薦 Ctrl + H 或導航到 首頁 > 查找和選擇 > 更換 打開 查找和替換 對話框。
  3. 查找和替換 對話框:
    1)。進入 空白鍵和星號 *查找內容 框;
    2)。 留著空白 ,在 更換 框;
    3)。最後,點擊 “全部替換” 按鈕。
  4. 現在,所有時間都已從日期範圍中刪除,日期可能仍會顯示時間部分 00:00:00。看截圖:
  5. 然後,您可以透過點擊設定範圍格式以僅顯示日期 首頁 > > 短期約會。 看截圖:
尖端:使用 查找和替換 非常棒,因為您可以在數據所在的同一單元格中直接更改數據,而無需額外的列。請記住製作備份副本,以防您以後再次需要原始資料。這樣,您就可以保持物品整潔和安全!

相關文章:

  • 在Excel中從日期時間中刪除日期
  • 如果您的工作表中有日期和時間戳的列表,現在您想從日期時間中刪除日期,只保留時間。 您有快速的方法來處理這項工作嗎?
  • 將文本和日期合併到Excel中的同一單元格中
  • 假設您有兩列,其中一列包含文本字符串,另一列填充了日期,現在,您想將這兩列合併以獲得以下屏幕快照結果。 我們大多數人可能直接將兩列連接起來,但是日期將顯示為整數。 本文,我將介紹一些有效的方法來將文本和日期正確組合到Excel中的一個單元格中。
Comments (32)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Just copy the columns and paste them in a txt file, the txt file will not show the hours and minutes. Copy the dates from the txt and paste it back to the xls file. pretty easy
This comment was minimized by the moderator on the site
Copy to a cell and format as general (MS Date Value), then ROUNDDOWN,0 Simple.
This comment was minimized by the moderator on the site
what i've noticed is that when you clean the "date" column, you will always get a standard Number comprised of 5 digits. Usually it something like 43xxx. If the cell contains a timestamp ( 09:40:33) , your number will be 43xxx.yyy, where .yyy contains the details of the Hours:minutes:seconds. What always works a treat for me is to eliminate what's after the "." . To do this, I simply use =left(clean(A1),5) , whereby A1 = cell with the date stamp :) hope this helps anyone.
This comment was minimized by the moderator on the site
This was so helpful and worked for my needs exactly! Thank you!
This comment was minimized by the moderator on the site
Thanks a lot! For me it worked. Is funny you can found better solutions in the comments section than in the actual post ;)
This comment was minimized by the moderator on the site
useful, thanks
This comment was minimized by the moderator on the site
thank you !!!
This comment was minimized by the moderator on the site
cara show de bola
muitissimo obrigado
This comment was minimized by the moderator on the site
Thanks you so much , for that replace option work,,thank you
This comment was minimized by the moderator on the site
Thank you! This helped me a great deal to make dates so that I can then create charts showing accurate trends in performance.
This comment was minimized by the moderator on the site
just use formula =int(date)
This comment was minimized by the moderator on the site
dropping the time with a global replace - GENIUS, dude (...or dudette).
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