+ Reply to Thread
Results 1 to 4 of 4

Time between date format of type yyyymmddhhmmss

  1. #1
    Registered User
    Join Date
    03-02-2009
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    2

    Time between date format of type yyyymmddhhmmss

    Hi,

    I have 2 dates format like 200903021124 and 200903030254
    How do I use excel or excel VBA to calculate what is the time that elapses between this 2 date format?


    Rgds,
    Samuel
    Last edited by boisonbeauty; 03-02-2009 at 08:45 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Time between date format of type yyyymmddhhmmss

    Samuel, obviously it would help if you identified what the values reflected ... ie is it YYYYMMDDhhmm or YYYYDDMMhhmm ?

    Assuming 200903021124 = 2nd March 2009 11:24 ... and you're looking to subtract A1 from B1 (given B1 would be 3rd March):

    C1:
    =TEXT(B1,"0000-00-00 00\:00")-TEXT(A1,"0000-00-00 00\:00")

    C1 would be a time value so you would need to use a Time Format to display correctly, eg a Custom Format of:

    [hh]:mm

    Would display 15:30

  3. #3
    Registered User
    Join Date
    03-02-2009
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Time between date format of type yyyymmddhhmmss

    Thank you very much, DonkeyOte.

    It works perfectly. However, I just made slight modification to it to be

    C1:
    =TEXT(B1,"0000-00-00 00\:00\:00")-TEXT(A1,"0000-00-00 00\:00\:00")

    as my A1 and B1 is in the format of yyyymmddhhmmss (with second interval behind)


    Rgds,
    Samuel

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Time between date format of type yyyymmddhhmmss

    Glad to hear it - please mark as SOLVED (see How To section for more info.)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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