+ Reply to Thread
Results 1 to 7 of 7

Difference In Date/Times

  1. #1
    Registered User
    Join Date
    03-13-2012
    Location
    Atlanta
    MS-Off Ver
    Office 2010
    Posts
    8

    Difference In Date/Times

    Trying to figure out how to display the difference in two date/time stamps. I've found a number of hits on the web, but nothing exactly the same as my situation.

    I'll have two date/time stamps in two cells that are each a text string:
    B7: 10/21/2019 11:21
    D7: 10/22/2019 13:59

    In D8, I have just '=D7-B7' this gives me the value 1.110150463. What I'm looking for is a value formatted as days:hours:minutes.

    Am I missing something obvious?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Difference In Date/Times

    You can apply a custom format to D8 of:

    d h:mm:ss

    though if the difference is more than 31 days the day value will wrap at 31. To prevent that from happening, you would need a more complex formula which would have the effect of turning the answer to text.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    03-13-2012
    Location
    Atlanta
    MS-Off Ver
    Office 2010
    Posts
    8

    Re: Difference In Date/Times

    Wow, that was quick and it works perfectly.

    Thank you so much

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Difference In Date/Times

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    03-13-2012
    Location
    Atlanta
    MS-Off Ver
    Office 2010
    Posts
    8

    Re: Difference In Date/Times

    If I may ask one more question on the formatting?

    Now trying to figure out how to format that date field with literals like "d days h hours mm minutes" to make it easier to read for the people I am sending the spreadsheet to.

  6. #6
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Difference In Date/Times

    Type the following as in the custom section of formatting screen

    d "days" h "hours" mm "minutes"

    this should give you your desired outcome..

  7. #7
    Registered User
    Join Date
    03-13-2012
    Location
    Atlanta
    MS-Off Ver
    Office 2010
    Posts
    8

    Re: Difference In Date/Times

    Thank you! I had tried that, but wasn't using the quotes around the literals.

    Again, I very much appreciate the help!

+ 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] difference in 2 times but:-
    By Russski in forum Excel General
    Replies: 5
    Last Post: 04-14-2016, 08:47 AM
  2. [SOLVED] Difference between two times - avoiding ###### for times that span midnight
    By Abarency in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-07-2015, 01:15 PM
  3. [SOLVED] Difference between two Date and Times cell in Hours
    By kidengineer in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-23-2013, 04:05 AM
  4. [SOLVED] Date format problem using a formula in VBA to calculate difference between times and dates
    By alicebrewer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2012, 03:13 AM
  5. Difference in Date and Times
    By zachharriman in forum Excel General
    Replies: 7
    Last Post: 08-26-2008, 01:41 PM
  6. Difference between date and times
    By Neil_Pattison in forum Excel General
    Replies: 2
    Last Post: 08-16-2006, 09:30 AM
  7. [SOLVED] Calculate difference between 2 date and times with average
    By Aeryn635 in forum Excel General
    Replies: 1
    Last Post: 12-14-2005, 11:10 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