+ Reply to Thread
Results 1 to 6 of 6

Trying to show Days and Hours in a cell

Hybrid View

  1. #1
    Registered User
    Join Date
    03-09-2022
    Location
    Philadelphia
    MS-Off Ver
    2201
    Posts
    7

    Trying to show Days and Hours in a cell

    Hello, I am a very amateur excel user. I practically have never used it until I got my current job about a year ago, and now everyone relies on me to help/ show them how to use excel. I pretty much google everything but for some reason I am unable to find this answer on google.

    I am trying to make a chart showing the days and hours it takes for something to be done.
    I was using the formula d"d" h"h" but for some reason it doesn't work anymore. Whenever I try to add the days and hours it only adds the hours and it's a completely different hour than what I entered. I am still very new to excel so I know I very well could be doing something wrong.

    Also once I figure out how to show days & hours in the cell, is there a way to sum the total of days/hours? I have looked this up as well, but I just don't understand these formulas some people send, I always get an error when entering it.

    If anyone could help me, that would be amazing!


    Thank you in advance!
    - Your friendly neighborhood excel dumbie
    Last edited by AliGW; 03-31-2022 at 01:06 PM.

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

    Re: Trying to show Days and Hours in a cell

    Welcome to the forum.

    It would help if you attached a sample Excel workbook with a few examples of your data and showing clearly what you want to achieve - follow the instructions in the yellow banner at the top of the screen for how to attach a workbook (don't try to use the paperclip icon, as it doesn't work on this forum).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    03-09-2022
    Location
    Philadelphia
    MS-Off Ver
    2201
    Posts
    7

    Re: Trying to show Days and Hours in a cell

    I have added a sample worksheet with my formulas. I know E4 has a different formula, I was trying to see if that would work.
    Attached Files Attached Files

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

    Re: Trying to show Days and Hours in a cell

    First of all, you are not using a formula to change the display - you are using a Custom Format.

    Secondly, all your totals seem to be correct - ignore what it says in the formula bar.

    So, what exactly is the problem?

    Pete

  5. #5
    Registered User
    Join Date
    03-09-2022
    Location
    Philadelphia
    MS-Off Ver
    2201
    Posts
    7

    Re: Trying to show Days and Hours in a cell

    Sorry Pete, like I said I am still very new, I guess I mixed up format with formula, honest mistake. But regardless are you able to see why the format is not working in some cells but is working in others?
    For example, cell E3 I am trying to get it to show 2d 9h but when I type 02:09 for the dd hh format, it is coming up as 0d 2h

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

    Re: Trying to show Days and Hours in a cell

    That is because if you enter 02:09 into a cell then Excel concludes that you have entered a time of 2 hours and 9 minutes, and because of your formatting this then shows as zero days and 2 hours. You need to appreciate that formatting does not change the actual value of a number - instead it only affects how that number is displayed.

    It would also help you if you realise that the way Excel treats dates and times is to consider dates as the number of elapsed days since some reference date (actually 1st January 1900) and are thus whole numbers, and times are fractions of a 24-hour day, so that 12:00 is stored internally by Excel as 0.5, whereas 6:00am is represented by 0.25 and 6:00pm (or 18:00) is stored as 0.75. Also, Excel is programmed to recognise certain characters during input and tries to make sense of what has been entered. So, in USA the three parts of a date are usually separated by the symbol / and are considered to be in month-date-year order, so if you type in the string of characters 12/31/21 then Excel recognises that as a date representing 31st December 2021, as any year part less than 30 is taken to be in the current century. However, if you were to enter 13/31/21 then Excel would return this as a text value, as it would not be able to make sense of there being 13 months. Other special characters include the colon : which is used to separate times into hours-minutes-seconds (in that order), and Excel will make allowance for more than 24 hours or more than 60 minutes or seconds, rounding up to the next higher unit as necessary. So, if you enter 25:15 into a cell which is formatted to show days and hours, then Excel will assume that you have entered 25 hours and 15 minutes and zero seconds and show it as 1d 1h.

    In conclusion, if you wanted to enter a value of 2 days and 9 hours into a cell, you can do it as:

    1/2/1900 9:0:0

    to avoid any ambiguity. With the formatting that you have applied, this would then show as 2d 9h.

    Slightly less typing would be to enter it as 57:0, and this would also show as 2d 9h (i.e. 57 hours and zero minutes). In the formula bar it would show as 1/2/1900 9:0:0, although you didn't enter that.

    Hope that begins to make it a bit clearer (though dates and times can be very confusing).

    Hope this helps.

    Pete

+ 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. Replies: 20
    Last Post: 07-28-2019, 04:02 AM
  2. Replies: 2
    Last Post: 12-05-2018, 01:46 AM
  3. Replies: 8
    Last Post: 05-12-2017, 11:04 AM
  4. [SOLVED] Subtracting Dates to Show Hours Spanning Multiple Days
    By andylee1892 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-04-2016, 01:43 PM
  5. cell value as 8hr days and hours
    By robert.begley1 in forum Excel General
    Replies: 3
    Last Post: 10-03-2014, 08:10 PM
  6. Replies: 2
    Last Post: 07-08-2014, 07:00 PM
  7. [SOLVED] what format to use to show days in hours
    By wayneg in forum Excel General
    Replies: 2
    Last Post: 11-22-2012, 10:33 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