+ Reply to Thread
Results 1 to 12 of 12

Automatically deduct lunch breaks

  1. #1
    Registered User
    Join Date
    05-02-2013
    Location
    Orange, CA
    MS-Off Ver
    Excel 2013
    Posts
    7

    Arrow Automatically deduct lunch breaks

    Before asking I tried doing some research on possible formulas but I guess I am not getting it. also I have a basic/intermediate knowledge of excel. and I only have about two weeks on excel2013 previously on 2007.

    So question is I need a formula to automatically deduct 30min of lunch if they worked 8hrs or no lunch break if they work 4hrs.

    8hrs deduct 30mins
    4hrs no lunch

    I found the following formula but it is not working:

    =(B3-A3)*24-IF((B3-A3)*24>8,1,IF((B3-A3)*24>6,0.5,0))

    Cells in A&B are formatted 1:30PM
    Cell in C is formatted [h]:mm

    In advance, thank you for time and patience.

  2. #2
    Registered User
    Join Date
    05-02-2013
    Location
    Orange, CA
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Automatically deduct lunch breaks

    Here is a snapshot of what I have:

    timesheet.jpg

  3. #3
    Registered User
    Join Date
    05-02-2013
    Location
    Orange, CA
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Automatically deduct lunch breaks

    If you have a better and/or simpler formula I will test it!

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,332

    Re: Automatically deduct lunch breaks

    Please Login or Register  to view this content.
    Try this one
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  5. #5
    Registered User
    Join Date
    05-02-2013
    Location
    Orange, CA
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Automatically deduct lunch breaks

    Hi Popipipo,

    Thank you!

    Just had to change 1/24 -> 1/48 as it was subtracting 1:00 instead of :30

    but now I have another dilemma:

    now that I have calculated the total hours per day, the sum of all five days do not add up! :-(

    8:00 + 4:00 = 12:00 (but system response is 10:30)

    formula =sum()
    formatted [h]:mm

    timesheet-2.jpg

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,332

    Re: Automatically deduct lunch breaks

    If you upload a xls file , I will look at it.

  7. #7
    Registered User
    Join Date
    05-02-2013
    Location
    Orange, CA
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Automatically deduct lunch breaks

    ok, here it is.

    timesheet-test.xlsx

  8. #8
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,332

    Re: Automatically deduct lunch breaks

    How long is the luchbreak if they work 4:30 hours
    With other words: From what time do they have a lunch break?

  9. #9
    Registered User
    Join Date
    05-02-2013
    Location
    Orange, CA
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Automatically deduct lunch breaks

    there is only two options

    8hrs 30mins
    4hrs no lunch

    there will be no other times between

  10. #10
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,332

    Re: Automatically deduct lunch breaks

    Take a look at the orange cells
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    05-02-2013
    Location
    Orange, CA
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Automatically deduct lunch breaks

    Ok, I got the result of 12 on cell M5 as what I wanted

    What did you do to cell M5 to produce the correct answer?

    AND

    why did you change the formula from the original one? the original formula you provided was correct!

  12. #12
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,332

    Re: Automatically deduct lunch breaks

    Please Login or Register  to view this content.
    I add the first part of the formula
    And I removed the part of the formula about the 4 hours working time.
    Because then you don't substract anything.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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