Tom W
Tom W

Reputation: 1

Excel Convert DateTime stored as Text, YYYYMMDDhhmmss, to formatted date and time "mm/dd/yy hh:mm"

I have date-times stored as unformatted text,YYYYMMDDhhmmss,(ex. 20191015172328= 10/15/19 17:23) that I want to convert to formatted date and time "mm/dd/yy hh:mm"

Is this possible in one formula?

The closest I can come is splitting the cell into two columns date, and time. Then applying =DATE(LEFT(B2,4), MID(B2,5,2), RIGHT(B2,2)) next to date column, and =TIME(LEFT(E2,2), MID(E2,3,2),RIGHT(E2,2)) next to time column. This gets to correct format but two separate columns which I then have to convert back to text to combine into one final column. Thanks.

Upvotes: 0

Views: 2796

Answers (1)

BigBen
BigBen

Reputation: 50008

You were close. Just add the result of DATE and TIME together:

=DATE(MID(B2,1,4),MID(B2,5,2),MID(B2,7,2))+TIME(MID(B2,9,2),MID(B2,11,2),MID(B2,13,2))

enter image description here

Upvotes: 1

Related Questions