+ Reply to Thread
Results 1 to 6 of 6

Expressing a number into days-hours-minutes

  1. #1
    Registered User
    Join Date
    07-02-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    2

    Expressing a number into days-hours-minutes

    Hi,

    I'm hoping someone here might be able to help me please?

    I am trying to write a function that will convert a number into days-hours-minutes. I have managed to get as far as hours-minutes using the following function.

    =INT(A1/60)&"h "&ROUND(MOD(A1/60,1)*60,0)&"m"

    e.g. If A1 = "7090" the result of this function will be "118h 10m".

    I now need to express the result as xxxd xxxh xxxm and this is where I am stuck!

    Thanks in anticipation.

    Steve
    Last edited by stbrewin; 07-02-2009 at 07:01 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Expressing a number into days-hours-minutes

    Well you can divided by 1440 (60*24)

    =A1/1440

    Apply a custom format of:

    [hh]"h" mm"m"

    or for days etc...

    d"d" hh"h" mm"m"

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Expressing a number into days-hours-minutes

    why not use
    7090/1440
    format cell d hh mm
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Expressing a number into days-hours-minutes

    And then there's my approach, which as always, is outrageously convoluted, and probably doesn't make any sense to anyone without some form of brain damage.

    Please Login or Register  to view this content.
    Will take your number thingy, and output:
    4 days 22 hours 10 minutes

    lol @ me.

    mew!
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

  5. #5
    Registered User
    Join Date
    07-02-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Expressing a number into days-hours-minutes

    I like this - thanks!!!

  6. #6
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Expressing a number into days-hours-minutes

    probably doesn't make any sense to anyone without some form of brain damage
    I like this - thanks!!!
    Alright then, so maybe it's not just me. :P

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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