+ Reply to Thread
Results 1 to 3 of 3

help with nested if than and possible MOD formula

  1. #1
    Registered User
    Join Date
    06-17-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    help with nested if than and possible MOD formula

    Hello, I was elected by my employer to write a formula for a "line bar" scheduling program that we use because I have some experience with Excel. I have been trying to figure this formula out for a LONG time and cannot wrap my head around it. Any help would be appreciated.
    Here is what I have I have a spreadsheet that breaks down the work day hour by hour. I need it to display how much time elapses between the two cells (for example if an employee comes in at 7:30 am and works until 2 pm than it needs to show a 0.5 in the first box, than a 1 in each box until the 2 pm box). I have posted the spreadsheet so far:
    Monday
    6:00 7:00 8:00 9:00 10:00 11:00 12:00 13:00 14:00 15:00 16:00 17:00 18:00 19:00 20:00 21:00 22:00 23:00 0:00 1:00 2:00
    Projected sales 0 0 0 0
    Labor guide 34 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
    Scheduled 8
    Guide +/- -49.5
    Name In Out 6:00 7:00 8:00 9:00 10:00 11:00 12:00 13:00 14:00 15:00 16:00 17:00 18:00 19:00 20:00 21:00 22:00 23:00 0:00 1:00 2:00 3:00
    employee a 6:30 14:00 0.5 1 1 1 1 1 1 1
    employee b 14:00 23:00 PM 1 1 1 1 1 1 1 1 1
    employee c 14:00 2:00 AM
    employee d 15:00 cl



    The problem that I am having is that I have a formula that only partially works:

    =IF(OR($B9>=H$8,$C9<=G$8),"",IF(AND($B9<=G$8,$C9>=H$8),1/24,IF(AND($B9>G$8,$C9>H$8),H$8-$B9,$C9-MAX($B9, G$8))))

    It does not work for times midnight until 3 am. I played around with a MOD formula but still cannot get anything to work.
    I also need to include in that formula that if "cl" (close) is entered in the out time it references a cell to get the closing time of the store to do the calculations

    Please help

    thanks,

    Lucas
    Attached Files Attached Files
    Last edited by workatw; 06-18-2013 at 09:21 AM.

  2. #2
    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,946

    Re: formula needs a little tweaking

    Hi and welcome to the forum

    We would love to help you with your question, but 1st, in accordance with forum rules, please rename your thread to something more meaningful, that actually describes your problem.

    Because thread titles are used in searching the forum it is vital they be written to accurately describe your thread content or overall objective using ONLY search friendly key words. That is, your title used as search terms would return relevant results.

    Many members will look at a thread title, and if it is of interest to them, or it falls within their area of expertise, they might only open those threads.

    Look at it this way...if you typed that title into google, what would you expect to get back?
    To change a Title on your post, click EDIT on you're 1st post, then Go Advanced and change your title



    Also, I dont see any file attached?
    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

  3. #3
    Registered User
    Join Date
    06-17-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: formula needs a little tweaking

    thank you for your helpful advice. I have attached the file and have changed the name to be more relevant.
    I hope that you or someone can help me with this. I appreciate any help that can be provided, as I have reached a dead end.

+ 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