convert 20230201000051 to date and time

junkforhr

Board Regular
Joined
Dec 16, 2009
Messages
115
Office Version
  1. 365
Platform
  1. Windows
Hi, I have data like below. This is just a sample and the actual data is about 20k rows.

The column with the date and time is unhelpful and I'd like 3 new columns (as per my desired result below), ideally formatted as Date, Time and Date and Time respectively.

Hoping someone can help.

Original data
20230201000051​
20230201000121​
20230201000223​
20230201000240​
20230201000308​
20230215165310​
20230215165357​
20230215165922​
20230215161358​
20230215165222​
20230215164502​

Desired Result

Original dataDateTimeDate and Time
20230201000051​
1/02/2023​
00:00:5101/02/2023 00:00:51
20230201000121​
1/02/2023​
00:01:2101/02/2023 00:01:21
20230201000223​
1/02/2023​
00:02:2301/02/2023 00:02:23
20230201000240​
1/02/2023​
00:02:4001/02/2023 00:02:40
20230201000308​
1/02/2023​
00:03:0801/02/2023 00:03:08
20230215165310​
15/02/2023​
16:53:1015/02/2023 16:53:10
20230215165357​
15/02/2023​
16:53:5715/02/2023 16:53:57
20230215165922​
15/02/2023​
16:59:2215/02/2023 16:59:22
20230215161358​
15/02/2023​
16:13:5815/02/2023 16:13:58
20230215165222​
15/02/2023​
16:52:2215/02/2023 16:52:22
20230215164502​
15/02/2023​
16:45:0215/02/2023 16:45:02
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Upvote 1
Solution
actually you don't need the 1* in the time calculation. The problem was with zero length text character in the value as I copied your data over. So, this should work for you:
Excel Formula:
=TIME(MID(A2,9,2),MID(A2,11,2),MID(A2,13,2))

and possibly:
Excel Formula:
=TIME(MID(A2,9,2),MID(A2,11,2),RIGHT(A2,2))
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,643
Members
449,093
Latest member
Ahmad123098

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