+ Reply to Thread
Results 1 to 8 of 8

Get the difference between long time strings [format - yyyy-mm-dd hh:mm:ss,SSS]

  1. #1
    Registered User
    Join Date
    07-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    9

    Get the difference between long time strings [format - yyyy-mm-dd hh:mm:ss,SSS]

    Hello,

    I have to prepare a report for a particular API performance. So I record start time and end time of operation for that API. I have several such rows for different input. The 2 strings are in the following format:

    StartTime
    2012-07-10 17:26:34,837

    EndTime
    2012-07-10 17:28:35,786

    Can you let me know how I can get these 2 time strings difference in excel sheet ? I use MS Excel 2003. I should ideally get something like - 0 Days and (approx) 0:02:01 milliseconds difference. Or atleast 0:02 minutes.


    Thank you,
    Samjna.

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

    Re: Get the difference between long time strings [format - yyyy-mm-dd hh:mm:ss,SSS]

    Just subtract the smaller from the larger and format as [h]:mm:ss.000
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Get the difference between long time strings [format - yyyy-mm-dd hh:mm:ss,SSS]

    Thank you, but It's not working. I tried

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I see an error:

    A Value used in the formula is of the wrong data type.

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

    Re: Get the difference between long time strings [format - yyyy-mm-dd hh:mm:ss,SSS]

    Works for me:

    Please Login or Register  to view this content.
    Last edited by shg; 07-13-2012 at 07:12 PM. Reason: date format was missing hours ...

  5. #5
    Registered User
    Join Date
    07-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Get the difference between long time strings [format - yyyy-mm-dd hh:mm:ss,SSS]

    Shg I understand. But you changed the string format here. I cant afford to change the format manually like this

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

    Re: Get the difference between long time strings [format - yyyy-mm-dd hh:mm:ss,SSS]

    I assumed that was a reflection of your regional settings for the decimal separator -- no?

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

    Re: Get the difference between long time strings [format - yyyy-mm-dd hh:mm:ss,SSS]

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Get the difference between long time strings [format - yyyy-mm-dd hh:mm:ss,SSS]

    Brilliant! It works for me, shg. Thank you

+ 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