Shwe Khine
Shwe Khine

Reputation: 115

Convert Text to datetime in MS Excel

I am trying to convert form DateTime value string such as "Feb 13, 2015 20:03:36:820" to DateTime values in Microsoft Excel. I know I can convert from a string such as '01/12/2015' to Date. But I want both date and time parts. Is there anyway we can do it?

Upvotes: 2

Views: 4712

Answers (1)

Gary's Student
Gary's Student

Reputation: 96753

With your data in A1, in B1 enter:

=DATEVALUE(MID(A1,1,12))

and in C1 enter:

=TIMEVALUE(MID(A1,14,8))

Then give B1 a Date format and give C1 a Time format.

enter image description here

EDIT#1

To use a Single cell the formula would be:

=DATEVALUE(MID(A1,1,12)) + TIMEVALUE(MID(A1,14,8))

enter image description here

Upvotes: 4

Related Questions