简体   繁体   中英

Text to Columns in Excel Split date and time

I have a small issue. I need to split the date and time within one cell. Normally I would do a text to columns and use delimited by space. But that issue is the AM and PM is put into it's own column. What I am trying to do is split out the date and have the time connected to the AM or PM in the same column as shown in the image below. Want to produce Column T and U. I want the 5:00:00AM to look like that where the AM is attached to the last number

在此处输入图片说明

In T2 enter:

=INT(N2)

In U2 enter:

=N2-T2

Then apply appropriate format to the cells.

在此处输入图片说明

EDIT#1:

To remove the space before the AM / PM , use a custom format:

在此处输入图片说明

Use Text-to-Columns, Fixed width. Double-click the little arrow on top of the vertical line separating AM/PM into its own column. Alternately, Drag it out of the little text window. This removes it and combines the second and third column.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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