+ Reply to Thread
Results 1 to 6 of 6

Need Help With Rounding in Timecard

  1. #1
    Registered User
    Join Date
    10-15-2015
    Location
    MN, US
    MS-Off Ver
    2013
    Posts
    3

    Need Help With Rounding in Timecard

    Attachment is a timecard I created and need help with adding round to the formulas. There are examples in there, so please help.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Need Help With Rounding in Timecard

    Quote Originally Posted by fher View Post
    Attachment is a timecard I created and need help with adding round to the formulas.
    I infer that you want to round to the half hour. If that's the case, enter the following formulas and copy down the columns.
    Please Login or Register  to view this content.
    Explanation.... Excel time is stored as a fraction of a day. Multiplying by 48 (24*2) converts Excel time to the number of half hours, which we round. Dividing the rounded number of half hours by 48 converts back to Excel time.
    Last edited by joeu2004; 10-15-2015 at 02:30 AM. Reason: explanation

  3. #3
    Registered User
    Join Date
    10-15-2015
    Location
    MN, US
    MS-Off Ver
    2013
    Posts
    3
    Quote Originally Posted by joeu2004 View Post
    I infer that you want to round to the half hour. If that's the case, enter the following formulas and copy down the columns.
    Please Login or Register  to view this content.
    Explanation.... Excel time is stored as a fraction of a day. Multiplying by 48 (24*2) converts Excel time to the number of half hours, which we round. Dividing the rounded number of half hours by 48 converts back to Excel time.

    Thank you for fast replied. Away from my pc now so will check it later but if I want a15 mins block, I can just replace "00:15" for the 48 right?

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help With Rounding in Timecard

    This has 8 helper columns. The formulas are all of the same general form.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    They express the times in minutes elapsed.

    Then starting in D2 this general form of rounded times continues to the next 2 columns. This is an array entered formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

    When finished format h:mm.

    The file is attached.
    Attached Files Attached Files
    Dave

  5. #5
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Need Help With Rounding in Timecard

    Quote Originally Posted by joeu2004 View Post
    Please Login or Register  to view this content.
    Quote Originally Posted by fher View Post
    if I want a15 mins block, I can just replace "00:15" for the 48 right?
    Let's look at an example....

    Instead of ROUND((MOD(C2-B2,1)-D2-E2)*48,0)/48, we might write:

    ROUND((MOD(C2-B2,1)-D2-E2)*1440/15,0)*15/1440
    or
    ROUND((MOD(C2-B2,1)-D2-E2)*96,0)/96

    (Note that 1440/30 = 48.)

    Hypothetically, if we want to use time constants like "00:15", we might write:

    MROUND((MOD(C2-B2,1)-D2-E2),"00:15")

    However, I deprecate the use of MROUND when the second parameter is not an integer. (Note that 00:15 = 0.25.) Infinitesimal binary arithmetic differences can arise, which might cause problems in dependent cells. For example:

    A1: =MROUND("12:30","00:15")
    B1: =MATCH(TIME(12,30,0),A1,0)

    A2: =ROUND("12:30"*1440/15,0)*15/1440
    B2: =MATCH(TIME(12,30,0),A2,0)

    B1 returns #N/A because the exact match fails. B2 returns 1 because the exact match succeeds.

    The binary difference between A1 and A2 is so small, we cannot see it even when formatted as Number with 16 decimal places because Excel formatting is limited to 15 significant digits.

    But MATCH does a binary comparison; so the infinitesimal difference affects MATCH.

    Aside.... We also cannot detect the binary difference if we write simply =A1-A2 or =(A1=A2). Both create the illusion that there is no difference because sometimes, Excel treats two values as exactly the same when their difference is "close to zero". Instead, we must write =A1-A2-0 formatted as Scientific or =(A1-A2=0), which defeat the dubious and inconsistently-applied "close to zero" heuristic.
    Last edited by joeu2004; 10-15-2015 at 07:58 AM. Reason: cosmetic

  6. #6
    Registered User
    Join Date
    10-15-2015
    Location
    MN, US
    MS-Off Ver
    2013
    Posts
    3

    Re: Need Help With Rounding in Timecard

    Thank you for all of you for helps. I use the *96,0)/96 to get the 15mins and it worked great but had another problem. Please check the new attachment here and see if the problem can be solved.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Rounding Help with Timecard to get proper calculations/overtime
    By phenomenal1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-22-2013, 03:27 PM
  2. Timecard formula
    By trav12d in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-04-2013, 04:41 PM
  3. Timecard Formula
    By Dihs in forum Excel General
    Replies: 5
    Last Post: 08-05-2010, 01:38 PM
  4. timecard
    By sanjay07 in forum Excel General
    Replies: 7
    Last Post: 11-30-2009, 09:46 AM
  5. Format Timecard
    By Gnathas in forum Excel General
    Replies: 3
    Last Post: 08-18-2009, 10:23 PM
  6. Add timecard
    By cstandifird in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-31-2009, 03:08 PM
  7. [SOLVED] Timecard
    By Michaela in forum Excel General
    Replies: 6
    Last Post: 01-03-2006, 09:55 AM
  8. Spreadsheet Timecard
    By B. Baumgartner in forum Excel General
    Replies: 3
    Last Post: 07-05-2005, 09:41 AM

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