+ Reply to Thread
Results 1 to 6 of 6

convert long number in cell to date and time

  1. #1
    Registered User
    Join Date
    05-06-2009
    Location
    Boston, MA
    MS-Off Ver
    Excel 2000
    Posts
    2

    convert long number in cell to date and time

    Hi, I have cells of data with a long string of numbers such as: 20090507225836

    Is there any easy way to convert them to date/time format, such as below?

    5/7/2009 22:58:36

    Thanks!
    Last edited by ajchandler; 05-08-2009 at 01:48 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: convert long number in cell to date and time

    One way:

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

    formatted as desired
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: convert long number in cell to date and time

    Or =TEXT(A1, "0000-00-00 00\:00\:00") + 0 and format as desired.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: convert long number in cell to date and time

    Quote Originally Posted by shg View Post
    Or =TEXT(A1, "0000-00-00 00\:00\:00") + 0 and format as desired.
    I was trying to figure that one out... the slashes always mess me up..

  5. #5
    Registered User
    Join Date
    05-06-2009
    Location
    Boston, MA
    MS-Off Ver
    Excel 2000
    Posts
    2

    Re: convert long number in cell to date and time

    Both of those ways work. YOU GUYS ROCK!!

    FYI.. not that I need to, but excel doesn't let me subtract the cell using one method from the cell using the other method. In other words, I'll need to choose one formula or the other.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: convert long number in cell to date and time

    Quote Originally Posted by ajchandler View Post
    Both of those ways work. YOU GUYS ROCK!!

    FYI.. not that I need to, but excel doesn't let me subtract the cell using one method from the cell using the other method. In other words, I'll need to choose one formula or the other.
    Not exactly sure what you mean.. both methods return the actual data as a numeric value.. not text strings...

    Also, If you are satisfied with the solution, please mark your thread as [Solved]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1