Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Custom Date/Time Format ? (2000)

    I have exported a fair amount of data from a Cognos/Impromptu report into Excel. There is one particular field (a date/time) field containing a string of data that I need to split in to two cells and then convert one field to a date format, yyyy/mm/dd, and the other field in to a time format, i.e. hh:mm:ss.0

    The string of information is as follows - 2005070514532507 or yyyymmddhhmmss00. What I'd like to do is 2005/07/05 in cell #1 and 14:53:25.07 in field #2.

    Any suggestions?

    Thanks!

    Scott

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Custom Date/Time Format ? (2000)

    Say that the data is in column A, starting in cell A2 (A1 is a cilumn header).
    The following formula in B2 will extract the date: =DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))
    Give B2 the custom date format yyyy/mm/dd and fill down as far as needed.
    In cell C2, enter this formula to extract the time: =TIME(MID(A1,9,2),MID(A1,11,2),MID(A1,13,2))+MID(A 1,15,2)/8640000
    (the hundredths of seconds are treated separately).Give C2 a custom format hh:mm:ss.00 and fill down as far as needed.

  3. #3
    Star Lounger
    Join Date
    Feb 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Date/Time Format ? (2000)

    Thanks Hans! It worked great! Appreciate your help.

    Scott

Posting Permissions

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