splitting and formating a number series into date/time

C

CMG8401

I have a data series that looks like:
20080127145747 (YearMonthDayHoursMinutesSeconds)

I need to break that up into two columns
Date (Month/Day/Year) and Time (Hours:Minutes:Seconds)

Please help
 
P

Pete_UK

With your number in A1, this will give you the date part (eg in B1):

=DATE(LEFT(A1,4),MID(A1,5,2),MID(7,2))

and this will give the time part (eg in C1):

=TIME(MID(A1,9,2),MID(A1,11,2),RIGHT(A1,2))

You need to format both cells to display the date and time how you
would like to see them, and then you can copy the formulae down as
required.

Hope this helps.

Pete
 
G

Gary''s Student

With your value in A1, enter in B1 and C1:

=DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))
=TIME(MID(A1,9,2),MID(A1,11,2),RIGHT(A1,2))
 
P

Pete_UK

Sorry, first one should have been:

=DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))

hope this helps.

Pete
 
D

David Biddulph

=INT(TEXT(A2,"0000\-00\-00 00\:00\:00"))
=MOD(TEXT(A2,"0000\-00\-00 00\:00\:00"),1)

Format as date & time respectively.
 
Top