+ Reply to Thread
Results 1 to 10 of 10

Convert a number into days and hours

  1. #1
    Registered User
    Join Date
    02-08-2007
    Posts
    5

    Convert a number into days and hours

    it seems that my original post got eaten by something or someone, so I will make a new short one.

    I have a number that I want to convert into days and hours in the following format: x days y hours.

    How do I do this.

    Thanx in advance for the help

    Neros

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Take a look at Chip's solution ...
    http://www.cpearson.com/excel/datearith.htm
    HTH
    Carim


    Top Excel Links

  3. #3
    Registered User
    Join Date
    02-08-2007
    Posts
    5
    Hi Carim

    I am very new to excel, so could you please tell me how to format the number into days and hours please.
    Thanx for your quick answer.

    Neros

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    What is your number ...?

  5. #5
    Registered User
    Join Date
    02-08-2007
    Posts
    5
    The number will differ, but the actual number is 194, which is 8 days and 2 hours, but how to put it together?

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    If you have 194 in A1 use this formula in B1

    =INT(A1/24)&" days "&MOD(A1,24)&" hours"

  7. #7
    Registered User
    Join Date
    02-08-2007
    Posts
    5
    We are getting closer here, Daddylongleg - except for the MOD(A1,24)&" that must read MOD(A1;24)&" ... (I guess).

    But the end result shows as 8 days 1,375 hours - I dont need the ,375 part tho - how do we get rid of that part (the hours changed in the meantime to 193 It is calculated from something else).


    neros

  8. #8
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Please Login or Register  to view this content.

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Quote Originally Posted by Neros
    We are getting closer here, Daddylongleg - except for the MOD(A1,24)&" that must read MOD(A1;24)&" ... (I guess).

    But the end result shows as 8 days 1,375 hours - I dont need the ,375 part tho - how do we get rid of that part (the hours changed in the meantime to 193 It is calculated from something else).


    neros
    My version of excel requires a comma in

    =INT(A1/24)&" days "&MOD(A1,24)&" hours"

    some versions require ; in place of , so, of course, yes, if that makes it work....

    Note if A1 actually contains 193 then you'll get a result of

    8 days 1 hours

    If you get

    8 days 1,375 hours

    that means that A1 contains 193,375 (possibly formatted to only show 193). If A1 might not contain an integer try

    =INT(ROUND(A1;0)/24)&" days "&MOD(ROUND(A1;0);24)&" hours"

  10. #10
    Registered User
    Join Date
    02-08-2007
    Posts
    5
    This is just SO Perfect now, Daddylonglegs!
    Thank you very much for your help!

    Neros

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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