+ Reply to Thread
Results 1 to 7 of 7

Deducting break from total hours worked

  1. #1
    Registered User
    Join Date
    09-16-2013
    Location
    Boston, Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    6

    Deducting break from total hours worked

    Hello,

    I have an Excel sheet set up to automatically calculate the total hours worked for me. I enter in the time in and out, and the total hours is automatically calculated. The formula I am using for that is,

    =IF(E90<D90,E90+1,E90)-D90

    The cell that calculates the above formula is formatted to Time, 13:30

    What I would like help with is how to deduct a half hour break from the total hours worked IF it is 6 hours or more and have it automatically calculate. I round the employee time either up to the nearest quarter or down depending whichever is closest, is there a way to have this factored in to the formula?

    Thank you for your help, I very much appreciate it.
    Last edited by robremsk01; 09-16-2013 at 05:08 PM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Deducting break from total hours worked

    =if(if(e90<d90,e90+1,e90)-d90>=(1/4),if(e90<d90,e90+1,e90)-d90-(1/48),if(e90<d90,e90+1,e90)-d90)

    1/4 = 6 hours

    1/48 = 30 min

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Deducting break from total hours worked

    =IF(E90<D90,E90+1,E90)-D90
    Like this:

    =MOD(E90-D90,1)

    Do you want to round then subtract the break or subtract the break then round?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    09-16-2013
    Location
    Boston, Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Deducting break from total hours worked

    Quote Originally Posted by daffodil11 View Post
    =if(if(e90<d90,e90+1,e90)-d90>=(1/4),if(e90<d90,e90+1,e90)-d90-(1/48),if(e90<d90,e90+1,e90)-d90)

    1/4 = 6 hours

    1/48 = 30 min
    Thank you for your response. I tried entering the above equation and it did not work. Do I need to enter the 1/4=6 hours 1/48 = 30 min into the equation? What should I be formatting the cell to - general, numbers?

  5. #5
    Registered User
    Join Date
    09-16-2013
    Location
    Boston, Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Deducting break from total hours worked

    Quote Originally Posted by Tony Valko View Post
    Like this:

    =MOD(E90-D90,1)

    Do you want to round then subtract the break or subtract the break then round?
    This equation does not deduct a 30 minute break. It does not matter, either way the number of hours worked comes out to be the same whether you deduct the break before or after.

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Deducting break from total hours worked

    Excel stores dates as they relate to 1/1/1900 by count of days, and time is a decimal value as it relates to 1, which is one day.

    A quarter of a day is literally the decimal .25, half hour is 1/48, and 15 minutes is 1/96.

    Therefore, the decimal value 25.5 = 25 days, 12 hours from 1/1/1900 or 1/25/1900 12:00:00

    If an end date and time minus the start date and time is larger than the decimal .25, then the length of time is greater than 6 hours.


    Using this you can build an IF that checks if time worked is 6 hours or more, and then act upon it.


    =if(if(e90<d90,e90+1,e90)-d90>=(6 hours),if(e90<d90,e90+1,e90)-d90-(30 minutes),if(e90<d90,e90+1,e90)-d90)


    The whole equation breaks down to: IF time worked >= 6 hours, subtract 30 minutes, IF not, don't subtract 30 minutes

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Deducting break from total hours worked

    That formula was to show you how to calculate the hours worked.

    To deduct 30mins if the total is >6hrs...

    D90 = time in
    E90 = time out

    =MOD(E90-D90,1)-IF(MOD(E90-D90,1)>6/24,30/1440)

    Format as h:mm

+ 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. Calculate total hours automatically deducting lunch breaks
    By GregoryB in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-03-2019, 11:58 AM
  2. Replies: 4
    Last Post: 02-12-2013, 07:01 AM
  3. Replies: 2
    Last Post: 02-11-2013, 02:26 PM
  4. Subtracting Break from Total Hours Worked
    By martah26 in forum Excel General
    Replies: 5
    Last Post: 05-21-2009, 11:08 PM
  5. subtracting a break from hours worked
    By truecam in forum Excel General
    Replies: 2
    Last Post: 08-18-2005, 09:05 PM

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