简体   繁体   English

在 Excel 中删除日期时间数字中的秒数

[英]Remove seconds in the date-time number in Excel

I have a column of date-time numbers, "DD/MM/YY HH:MM:SS".我有一列日期时间数字,“DD/MM/YY HH:MM:SS”。 At this moment, I want to remove "SS" from it and left "DD/MM/YY HH:MM".此时,我想从中删除“SS”并留下“DD/MM/YY HH:MM”。 I tried DATE and TIME function separately but only one part left, DATE :"DD/MM/YY" and TIME :"HH:MM", also, I tried CONCATENATE function but it doesn't work, so could anyone do me a favour?我分别尝试了 DATE 和 TIME 函数,但只剩下一个部分, DATE :"DD/MM/YY" 和TIME :"HH:MM",另外,我尝试了CONCATENATE函数但它不起作用,所以任何人都可以帮我青睐? Thanks in advance.提前致谢。

If you want to completely remove the seconds from the data.如果要从数据中完全删除秒。 Try: =1*TEXT(C2,"dd/mm/yyyy hh:mm")试试: =1*TEXT(C2,"dd/mm/yyyy hh:mm")

Multiplying the text result by 1 converts the text back to a number.将文本结果乘以 1 会将文本转换回数字。

Select the cell(s) to be modified and tap Ctrl + 1 .选择要修改的单元格并点击Ctrl + 1 Go to the Number tab and chose Custom from the list down the left.转到“数字”选项卡,然后从左侧列表中选择“自定义”。 Supply the following for the Type:类型提供以下内容:

dd/mm/yy hh:mm    ◄ EN-US
pp/kk/vv tt:mm    ◄ FI-FI

Click OK and you should be set.单击确定,您应该已设置好。

Ctrl+1 自定义数字格式

You can try LEFT .你可以试试LEFT Assuming I understand your question and you have DD/MM/YY HH:MM:SS in one cell, you can use =LEFT(cell,14)假设我理解您的问题并且您在一个单元格中有DD/MM/YY HH:MM:SS ,您可以使用=LEFT(cell,14)

试试这个公式:

Round(CELL * 60 * 24 , 0)/60/24

试试=TEXT(A1,"DD/MM/YY HH:MM")

I have a column showing dates "27/01/2015 18:43:00"我有一列显示日期“27/01/2015 18:43:00”

I changed them to show as Number "42031.78"我将它们更改为显示为数字“42031.78”

I then used Data/Text to columns and used the period or full stop as the delimiter.然后我将数据/文本用于列,并使用句点或句号作为分隔符。

This gave me two columns "42031.00" and "7798611111.00"这给了我两列“42031.00”和“7798611111.00”

I deleted the second column and changed the original column back to short date format.我删除了第二列并将原始列改回短日期格式。 "27/01/2015" “27/01/2015”

No more hours and seconds!没有更多的小时和秒!

要删除秒,只需执行 =INT("cell number"*1440)/1440

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM