+ Reply to Thread
Results 1 to 4 of 4

Custom Cell Format | Elapsed Time in Days (With Hours and Minutes)

  1. #1
    Registered User
    Join Date
    02-07-2022
    Location
    Finland
    MS-Off Ver
    2019, 365
    Posts
    49

    Custom Cell Format | Elapsed Time in Days (With Hours and Minutes)

    Hello everyone.


    Is there a way to use custom cell formatting to display time elapsed in days (with hours and minutes)?


    I have two time stamps:

    8/03/2022 15:56:00

    and

    20/05/2022 20:19:00


    If I subtract the former from the latter, I get:

    73.18263889

    which is the number of days as a fraction.


    Using the following custom formatting:

    [hh] "hours and" mm "minutes"

    displays the result in time elapsed in hours (with minutes), which is:

    1756 hours and 23 minutes.


    What I'm trying to do is display the results in time elapsed in days (with hours and minutes).

    So, naturally, I tried:

    [dd] "days," hh "hours and" mm "minutes"

    but sadly, it didn't work.


    Is there a solution to this using custom cell formatting?

    Thanks in advance!

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,880

    Re: Custom Cell Format | Elapsed Time in Days (With Hours and Minutes)

    No, there is no "elapsed days" date/time number format that will do what you want. Excel can only do calendar days, so the longest that it can display as elapsed days is 31 days.

    If you are willing to store the result as a text string, it should be possible to parse out days, hours, etc. and then join them together in a text string. Of course, numbers stored as text create plenty of other problems, so I would see this as only useful when the result is a "final" result and not an intermediate calculation.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Custom Cell Format | Elapsed Time in Days (With Hours and Minutes)

    Assuming your 2 dates were living in A1 and B1.

    I ABS the INT because if you are doing a countdown you may not want to see negative days. But if you do want to see "-3 days..." then take off the abs.

    As pointed out by MrShorty, you cannot do operational aggregates off the field after you force it to appear as a string... but it will display the text as desired.

    You can see that each time part is wrapped in an IF including the Days. All optional... but it will not display seconds or minutes or hours or days if there are 0 of that unit to display.

    Please Login or Register  to view this content.
    It can be much smaller if you are good with results that always display the parts...

    3 days 0 hours 2 minutes 12 seconds

    Please Login or Register  to view this content.

    If you need to do any operations against the times you should store the direct difference in a separate column to utilize while this would be a display choice only
    -If you think you are done, Start over - ELeGault

  4. #4
    Registered User
    Join Date
    02-07-2022
    Location
    Finland
    MS-Off Ver
    2019, 365
    Posts
    49

    Re: Custom Cell Format | Elapsed Time in Days (With Hours and Minutes)

    Sorry for the very late response.

    Thank you both for your 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. Conversion of Days Hours Minutes elapsed into minutes
    By FPGooner in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 11-16-2018, 05:57 PM
  2. [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
  3. [SOLVED] Elapsed Days Hours Minutes Excluding Weekends and Holidays
    By moshjosh in forum Excel General
    Replies: 7
    Last Post: 12-10-2012, 08:39 AM
  4. Excel 2007 : Elapsed Days, Hours, Minutes
    By janetk411 in forum Excel General
    Replies: 3
    Last Post: 12-07-2009, 11:06 AM
  5. [SOLVED] How to convert an elapsed time in minutes to Days hours and minute
    By Time Tracker in forum Excel General
    Replies: 1
    Last Post: 04-08-2006, 10:45 PM
  6. [SOLVED] 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
  7. format minutes to days hours & minutes
    By M.Siler in forum Excel General
    Replies: 4
    Last Post: 02-03-2006, 01: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