+ Reply to Thread
Results 1 to 7 of 7

Date/Timestamp difference in HH:MM

  1. #1
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Date/Timestamp difference in HH:MM

    Good day,

    I'm trying to calculate the difference between two date/timestamps in HH:MM, and am having no luck. Perhaps it's my utter lack of even basic mathematical abilities or not understanding the code samples I've found on various sites, but everything I do is just inaccurate.

    For example
    Start Date = 3/10/2014 8:30 AM
    End Date = 3/12/2014 9:45 AM
    Should result in 49:15

    Sometimes the dates will be on the same day, sometimes not.
    The start date could be in the last day or two of December, so the year matters, too.

    Thank you for any help.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Date/Timestamp difference in HH:MM

    I get 48h 45mins?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,038

    Re: Date/Timestamp difference in HH:MM

    I get 2 days 1hr 15mins
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Date/Timestamp difference in HH:MM

    Sorry, i'd put 9:15. Your formula will be end date-start date with a custom format of [hh]:mm

  5. #5
    Forum Expert
    Join Date
    02-22-2013
    Location
    London / Stockholm
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Date/Timestamp difference in HH:MM

    Try this:
    Please Login or Register  to view this content.
    Can easily be rewritten to a UDF.

    All best,
    Johan

  6. #6
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: Date/Timestamp difference in HH:MM

    Johan - thank you...that is exactly what I was looking for... will test out a few more scenarios but it looks great.

    Thank you...
    And to nathansav and Special-K.... I really appreciate your time as well!

  7. #7
    Forum Expert
    Join Date
    02-22-2013
    Location
    London / Stockholm
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Date/Timestamp difference in HH:MM

    You're welcome Thanks for your kind feedback and the positive rep added.

    Best,
    Johan

+ 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 a cell with a timestamp in it to just the date to compare to another date
    By Tanyab in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2013, 05:41 AM
  2. Adding date timestamp
    By BigBlackMamba in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-14-2010, 07:40 PM
  3. remove timestamp from date
    By surfengine in forum Excel General
    Replies: 2
    Last Post: 03-03-2010, 05:43 PM
  4. Help! How can I remove the date from a timestamp?
    By juddh in forum Excel General
    Replies: 1
    Last Post: 09-23-2009, 12:14 PM
  5. date without timestamp
    By r.vasikaran in forum Excel General
    Replies: 2
    Last Post: 05-13-2006, 07:10 AM

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