Text to columns time format gets AM/PM wrong

bchez

Board Regular
Joined
May 19, 2014
Messages
55
Column A
Column B
08/07/2019 12:00 AM
01/00/1900 7:03 AM

<tbody>
</tbody>
I am doing a text to columns where I have a date and time in Column A - and I want it to have the date in column A and the time in column B
Here is what the original looks like
08/07/2019 7:03 PM
The table above is what text to columns gives. When I format Col A to Date, short date that column is fine. When I format Col B to Custom h:mm AM/PM, it gets the AM or PM incorrect, randomly it seems. For example, in the table above, it should have been 7:03 PM instead of AM
Is there a way to fix this without VBA code? TY
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
What settings do you use with Text-to-Columns?

I suggest using Fixed width instead of a "space" delimiter.
 
Upvote 0
Thanks I tried that as well, and am getting the same result. Thank you for the suggestion.
 
Upvote 0
Did you remove the break line between 7:03 and PM with fixed width?
If PM is removed from the time then it will be read as 07:03 (24 hour format).
 
Upvote 0
I would love to share a file but I don't know how. As for links, I work in a hospital so everything is locked down tight.
 
Upvote 0

Excel 2010
ABCDEF
1Text to Columns
203/03/2019 7:03 PM03-03-197:03 PM03-Mar-1919:03Column A is text
301/01/2019 7:03 AM01-01-197:03 AM01-Jan-197:03Column A is text
403-03-19 19:0303-Mar-1919:03Column A is number
501-01-19 7:0301-Jan-197:03Column A is number
6
1b
Cell Formulas
RangeFormula
D2=LEFT(A2,10)+0
D4=INT(A4)
E2=RIGHT(A2,7)+0
E4=MOD(A4,1)


Data Text to Columns works see B2:C3

choices
- Fixed Width
- delete break line between time and PM
- Date type selected as appropriate
- Destination as appropriate
 
Last edited:
Upvote 0
Many thanks to you all. As several of you suggested, removing the break line between the time and PM did the trick - using Fixed width.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,031
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top