+ Reply to Thread
Results 1 to 2 of 2

Time difference in hours:minutes:seconds between two columns

  1. #1
    Registered User
    Join Date
    09-16-2009
    Location
    usa,florida
    MS-Off Ver
    Microsoft 365
    Posts
    30

    Time difference in hours:minutes:seconds between two columns

    Hi I would like to have a macro compare to columns's time and display the difference in (h:m:s).
    Example in the sheet attached
    Attached Files Attached Files
    Last edited by jfish; 04-14-2019 at 10:23 AM. Reason: solved

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,866

    Re: Time difference in hours:minutes:seconds between two columns

    This can be done more easily with a formula:

    =DATEVALUE(LEFT(B2,10))+TIMEVALUE(MID(B2,12,12))-DATEVALUE(LEFT(A2,10))-TIMEVALUE(MID(A2,12,12))

    Use custom format

    [h]:mm:ss

    Implemented in attached.
    Attached Files Attached Files
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Convert time of day format to hours,minutes and seconds like a timer/stopwatch
    By mutzie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-05-2019, 07:58 PM
  2. Excel time formatting (hours, minutes, seconds)
    By johncena69 in forum Excel General
    Replies: 3
    Last Post: 01-02-2017, 12:52 AM
  3. [SOLVED] VBA Code Question for Sorting Time Elapsed into Separate Columns Hours / Minutes / Seconds
    By unit285 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-12-2016, 11:15 AM
  4. Replies: 2
    Last Post: 07-19-2012, 12:48 PM
  5. Replies: 1
    Last Post: 11-02-2011, 06:50 PM
  6. Replies: 1
    Last Post: 11-02-2011, 06:44 PM
  7. Elapsed Time in Hours, Minutes and Seconds
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2006, 03:50 PM

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