text date & time conversion help

karkas

Board Regular
Joined
Oct 17, 2007
Messages
170
Office Version
  1. 2013
Platform
  1. Windows
I have a report where the cells are in text in this format "2018021409012900" it is YYYYMMDDHourHourMinMin. The last four digits are milliseconds which I don't need.

I need to convert this to a date & time cell that is more legible.

I can think of some labor intensive ways to do this, but I suspect there is a much simpler way that an expert here can help with.

Thanks in advance for any advice
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
This will convert it to a date and time, but it will be displayed as a numeric value. The alternative is to use a TEXT function, but then you won't be able to use the result in other formulae, so it depends what you're using this for...

=DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))&TIME(MID(A1,9,2),MID(A1,11,2),0)
 
Upvote 0
Here is another way:
Code:
=DATEVALUE(CONCATENATE(LEFT(A1,4),"/",MID(A1,5,2),"/",MID(A1,7,2)))+TIMEVALUE(CONCATENATE(MID(A1,9,2),":",MID(A1,11,2)))
 
Upvote 0
This will convert it to a date and time, but it will be displayed as a numeric value. The alternative is to use a TEXT function, but then you won't be able to use the result in other formulae, so it depends what you're using this for...

=DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))&TIME(MID(A1,9,2),MID(A1,11,2),0)

For some reason, this was giving me the wrong date 2018021408504900 --> 4/7/81 08:50 AM

=DATEVALUE(CONCATENATE(LEFT(A1,4),"/",MID(A1,5,2),"/",MID(A1,7,2)))+TIMEVALUE(CONCATENATE(MID(A1,9,2),":",MID(A1,11,2))) by Joe4, did work however.


Thank you both very much, you guys are genus's!
 
Upvote 0

Forum statistics

Threads
1,226,730
Messages
6,192,698
Members
453,747
Latest member
tylerhyatt04

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