• Custom Date/Time Format ? (2000)

    Author
    Topic
    #422127

    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

    Viewing 0 reply threads
    Author
    Replies
    • #961562

      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(A1,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.

      • #961633

        Thanks Hans! It worked great! Appreciate your help.

        Scott

    Viewing 0 reply threads
    Reply To: Custom Date/Time Format ? (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: