Results 1 to 8 of 8
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help! Time Calculation

    All I want, is to display my time in total minutes, no hours, I.E. 1:30:00 would return 90:00.. any ideas?

    Thanks!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Help! Time Calculation

    Try =(HOUR(NOW())*60)+(MINUTE(NOW()))

    regards,

    Andrew C

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help! Time Calculation

    A few questions before I could answer this question.

    If all you want is minutes, what is the :00 in your example? Do you want that to always be :00, or is that really seconds?

    I do not know of a way to do this with formatting, therefore, I do not know of a way to display what you want in the same cell that contains the time. I can come up with a formula that will display what you want in another cell. Would that be acceptable? Can the times be more than 24 hours?
    Legare Coleman

  4. #4
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help! Time Calculation

    in Excel
    if the contents of cell A1 is 16:48:00, then =Hour(A1)*60+Minute(A1) should give the total number of minutes in the specified time


    in VBA

    Sub test()
    Dim tt
    Dim MyHour
    Dim MyMin
    tt = Time
    MyHour = Hour(tt)
    MyMin = Minute(tt)
    MsgBox MyHour * 60 + MyMin
    End Sub

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help! Time Calculation

    Great! Thanks! Okay, here's a tougher one..

    Of those minutes, I want it to display a whole number, no time. I.E. 90:30 (mm:ss) would be 90.5.. any ideas? )

    Thanks!!


    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  6. #6
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help! Time Calculation

    in Excel

    = Hour(A1)*60 + Minute(A1) + Second(A1)/60

    in VBA

    Sub test()
    Dim tt
    Dim MyHour
    Dim MyMin
    Dim MySec
    tt = Time
    MyHour = Hour(tt)
    MyMin = Minute(tt)
    MySec = Second(tt)
    MsgBox MyHour * 60 + MyMin + MySec / 60
    End Sub

  7. #7
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Help! Time Calculation

    if a time is in A1 then =((HOUR(A1)*60*60)+(MINUTE(A1*60))+(SECOND(A1)))/60 should do it. that returns the number of minutes calculated from the number of seconds. You can format it show how many decimal places you like.

    Andrew C

  8. #8
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help! Time Calculation

    =A1*1440
    Legare Coleman

Posting Permissions

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