+ Reply to Thread
Results 1 to 5 of 5

Calculate meal periods based on total scheduled hours

  1. #1
    Registered User
    Join Date
    03-08-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    14

    Calculate meal periods based on total scheduled hours

    Hey fellow excelheads,

    I've been asked to update an excel based scheduler tool I created a few years ago. I've done some reformatting but I am having formula trouble trying to get total shift times to calculate with meal periods included based on total hours scheduled. Since I got great help here the last time I was having troubles I'm back because you all rock!

    Per our policy an employee will have a 1/2 hour meal period for a shift that is scheduled more than 5 hours but less than 10 hours and a 1 hour meal period for schedules that are 10 hours or longer.

    So what I was doing originally in rows 39-47 and 99-107 was running the calculations to deduct at 1/2 hour meal break if an X was placed in k39:k47 , U39:u47 , K99:K107, and U99:U107 with one row set for a 1 hour. This worked ok but a number of our locations are now running non-traditional schedules so this isn't working as well as it could be for calculating and showing total scheduled work hours vs physical hours for managing budgets.

    What I want this to do is have TTL Hours in columns J and T deduct the appropriate meal period based on the total hours scheduled and then place a 1 or a 2 in the corresponding K or U Column to reflect the number of meal periods.

    so J39 is my target cell this is the current formula =IF(I39="",0,IF(AND(K39=""),IF(G39<=I39,24*(I39-G39),24*(I39-G39)+12),IF(G39<=I39,24*(I39-G39)-0.5,24*(I39-G39)+12-0.5)))

    I need this to subtract .5 if the total is greater than or equal to 5 and less than 9.9( we only deal in quarter hour scheduling but I want a buffer in case someone does something unexpected) and subtract 1 if the total is equal to or greater than 10 ...I would love if it could also put a 1 or a 2 in K39 that would show if 1 meal period (.5 hours) or 2 meal periods (1 hour) was being deducted. This will show the person scheduling the total "work hours" that are scheduled not the physical number of hours that has been scheduled.

    Who's got some ideas because my brain is fried like an egg.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-08-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Calculate meal periods based on total scheduled hours

    I've changed my thinking on this and am going a different direction with my forumlations....i figured out how to simplify things ALOT...thanks for looking everyone

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Calculate meal periods based on total scheduled hours

    Would you mind sharing how you resolved this?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    03-08-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Calculate meal periods based on total scheduled hours

    Hopefully I can explain what I did here

    I moved and simplified the original formula that had the "hardcoded" breaks into the X column so that it would just calculate total hours scheduled =IF(I40="",0,IF(G40<=I40,24*(I40-G40),24*(I40-G40)+12))

    Then in the total hours box I put in this formula =IF($X40>=10,$X40-1,IF($X40>=5,$X40-0.5,$X40-0)) to designate the proper meal periods based on the total hours in X40

    I abandoned the need to input the 1 or 2 for number of meal periods as it was an un-needed redundancy

    I then carried the formulas to all related cells in my schedule array.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Calculate meal periods based on total scheduled hours

    Thanks for the reply

    Nicely done!
    Maybe a bit of a simplification?
    =IF(I40="",0,24*(I40-G40)+IF(G40<=I40,132,0))
    =$X40-IF($X40>=10,1,IF($X40>=5,0.5,0))

+ 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. [SOLVED] Formula to do Shift Count and total hours scheduled
    By rizmomin in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-17-2017, 02:47 PM
  2. [SOLVED] Need Help with formula to calculate "hours scheduled" based on employee's number
    By Dnakr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2014, 02:56 PM
  3. Excel Scheduling Tool Help Total Scheduled Hours
    By uhcord98 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-04-2010, 05:00 AM
  4. Total the hours scheduled
    By kabshire4608 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 01-06-2010, 03:59 PM
  5. scheduled hours total
    By Jeff Desruisseaux in forum Excel General
    Replies: 1
    Last Post: 07-01-2005, 07:05 AM
  6. scheduled hours total
    By Jeff Desruisseaux in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2005, 07:05 AM
  7. [SOLVED] scheduled hours total
    By Jeff Desruisseaux in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-01-2005, 07:05 AM

Tags for this Thread

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