Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Time in minutes and seconds (2K3)

    This is more a question of semantics as I am trying to find the easiest option. I have created a workbook that converts the times of my runs from hours, minutes and seconds to minutes and a decimal i.e. 1 hour 35 minutes and 23 seconds = 95.38 minutes. This is to allow me tocalculate calories burned, speed and effort calculations.

    I have been playing around with a very basic function and also built in functions and just wanted to see if what I have done could be problematic or if there are any tidier methods.

    Method 1
    A function

    Function runTime(Hr As Integer, Mn As Integer, Sc As Double)

    runTime = (Hr * 60) + Mn + Round((Sc / 60), 2)

    End Function

    Method 2
    Built-in function

    =TIME(A2,B2,C2)*1440


    Any views/ideas?
    Jerry

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Time in minutes and seconds (2K3)

    Built-in functions are much more efficient than user-defined functions, so method 2 is preferable, but in reality you won't notice the difference since the amount of data and formulas will be (relatively) small.

    Method 3: enter the time in cell A1 formatted as hh:mm:ss, enter the formula =A1*1440 in cell B1 and format cell B1 as a number with 2 decimals.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Time in minutes and seconds (2K3)

    Yep, makes sense, I just get fed up with the formatting of the colon <img src=/S/sad.gif border=0 alt=sad width=15 height=15>
    Jerry

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Time in minutes and seconds (2K3)

    I'd use method 2 then. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •