Results 1 to 6 of 6

Math Help - Help with calculating time

  1. #1
    Newbie
    Joined
    Aug 2009
    Posts
    3

    Smile Help with calculating time

    Hello

    I have an issue that i'm not familiar with and again equally not knowledgable to do...so i'm looking for the answer.


    the minimal increment a time to calculate on a spreadsheet that i'm working on is .25 minutes. If a user work time is 7.16 then his time within the spreadsheet is represented as 7.25.

    My question what is the calculation to make sure any number below .25 is rounded up to .25?

    Any help appreciated.

    -Shamunda
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Dec 2007
    From
    Ottawa, Canada
    Posts
    3,110
    Thanks
    68
    Quote Originally Posted by shamunda View Post
    My question what is the calculation to make sure any number below .25 is rounded up to .25?
    Are you sure that's all...what if it was 7.52:
    wouldn't you want that rounded to 7.75?

    Plus do you always want the next UP?
    Wouldn't you want 7.52 to be 7.50...the one closest?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    Jul 2009
    Posts
    152
    If I understand your question correctly, you just want to know how to round up to the quarter-minute. I assume that you're writing a computer program? I can tell you how to represent the problem mathematically in terms of functions, and then perhaps someone else can provide some efficient psuedocode.

    Let T represent the time worked in minutes. We want to round T up to the nearest quarter-minute. Thus we're only concerned with the fractional portion of T, let's call it (T), and let's call the integer portion [T]. Let T_r be the rounded time. Then

    T_r=\begin{cases} [T]\quad\text{if } (T)=0 \\ [T] + 0.25 \quad\text{if } 0<(T)\leq 0.25 \\ [T] +0.5\quad\text{if } 0.25<(T)\leq 0.5 \\ [T] + 0.75\quad\text{if } 0.5<(T)\leq 0.75 \\ [T] + 1\quad\text{if } 0.75<(T)<1 \end{cases}
    Last edited by AlephZero; August 4th 2009 at 07:31 PM. Reason: typo
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor

    Joined
    Apr 2005
    Posts
    16,004
    Thanks
    1660
    I imagine shamunda wants a formula that can be used in the spreadsheet. Of course, spreadsheets vary but Microsoft Excel has built in function "Floor" such that "Floor(A3, 0.25)" will reduce the number in Cell A3 to the closest multiple of .25 below the number in A3.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Aug 2009
    Posts
    3

    Thumbs up I would like to thank all of you!!

    Quote Originally Posted by AlephZero View Post
    If I understand your question correctly, you just want to know how to round up to the quarter-minute. I am assume that you're writing a computer program? I can tell you how to represent the problem mathematically in terms of functions, and then perhaps someone else can provide some efficient psuedocode.

    Let T represent the time worked in minutes. We want to round T up to the nearest quarter-minute. Thus we're only concerned with the fractional portion of T, let's call it (T), and let's call the integer portion [T]. Let T_r be the rounded time. Then

    T_r=\begin{cases} [T]\quad\text{if } (T)=0 \\ [T] + 0.25 \quad\text{if } 0<(T)\leq 0.25 \\ [T] +0.5\quad\text{if } 0.25<(T)\leq 0.5 \\ [T] + 0.75\quad\text{if } 0.5<(T)\leq 0.75 \\ [T] + 1\quad\text{if } 0.75<(T)<1 \end{cases}

    Yes That's exactly what i'm looking for!! I apologize for my late response but yes that's exactly what i'm looking for. I can write out the code for it, but i'm afraid my math skills are greatly inefficient

    Sham
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Aug 2009
    Posts
    3

    Screwed up bad

    Yeah i'm going to need help on the pseudo code as well. I thought i would be able to work it ouot until i realized i have no idea what that formula means :P

    So if someone can get me started I think i can take the rest on my own. My apologies for being a bit premature with excitment.

    -Sham

    Quote Originally Posted by HallsofIvy View Post
    I imagine shamunda wants a formula that can be used in the spreadsheet. Of course, spreadsheets vary but Microsoft Excel has built in function "Floor" such that "Floor(A3, 0.25)" will reduce the number in Cell A3 to the closest multiple of .25 below the number in A3.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 15
    Last Post: November 10th 2010, 05:12 AM
  2. Replies: 3
    Last Post: January 14th 2010, 04:42 AM
  3. Calculating the Time of a Trip
    Posted in the Algebra Forum
    Replies: 4
    Last Post: February 21st 2009, 11:36 AM
  4. Calculating the time of a Trip
    Posted in the Pre-Calculus Forum
    Replies: 2
    Last Post: November 12th 2008, 04:46 PM
  5. Calculating the Time of a Trip
    Posted in the Pre-Calculus Forum
    Replies: 2
    Last Post: August 21st 2008, 02:41 PM

Search Tags


/mathhelpforum @mathhelpforum