+ Reply to Thread
Results 1 to 4 of 4

return value of "1" if time is between (inclusive) two times PAST MIDNIGHT PROBLEM

Hybrid View

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Unhappy return value of "1" if time is between (inclusive) two times PAST MIDNIGHT PROBLEM

    sTUMPED! And, if someone thinks I'm attacking this completely wrong, advice welcome. I want to know the number of employees I have working in any given 1/2 hour.

    in a workbook:

    Sheet POSTS!:
    column D is date
    column E is text (employee category acronym "AA", "TA", etc...)
    column G is start time
    column H is end time

    Sheet ANALYSIS!:
    Cell B6 is 5:00 AM and each cell to the right is 1/2 hour increment to 3:00 AM, creating a GRID.
    Cell A6 is date (simple enough to = referencing cell in Sheet POSTS! going down Column A).

    In the grid below the timeline in Sheet ANALYSIS!, I want to return a value of "1" for every half-hour increment an employee with a particular acronym ("AA") is scheduled to work then in rows for each date above that grid total the columns for each 1/2 hour increment so I can see how many people are scheduled in any 1/2 hour.

    So, FIRST: the Grid:
    Some of these ending times are past midnight and, knowing Excel can't "really" tell time (midnight is 0), I'm at a loss.

    example of Sheet ANALYSIS!: This employee is working 10:30 PM - 2:00 AM on the 26th.

    |10:30 PM | 11:00 PM | 11:30 PM | 12:00 AM | 12:30 AM | 1:00 AM | 1:30 AM
    8/26 | 1 | 1 | 1 | 1 | 1 | 1 | 1


    How do I get the "1" and make sure it takes into account times past midnight?

    I've tried a few nested IF's to no avail. Again, maybe this is the wrong approach entirely for counting number of bodies needed? I'm thinking Gantt, but not sure that will give me the totals by 1/2 hour.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,006

    Re: return value of "1" if time is between (inclusive) two times PAST MIDNIGHT PROBLEM

    Can you upload example workbook with your inputs and desired output?
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    07-25-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: return value of "1" if time is between (inclusive) two times PAST MIDNIGHT PROBLEM

    Hmmmm. Error: File is too large (2M). Will happily email it. There's no corp sensitive stuff or anything.

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: return value of "1" if time is between (inclusive) two times PAST MIDNIGHT PROBLEM

    How about

    =--(AND(($A6+AC$6>=POSTS!$D4+POSTS!$F4),($A6+AC$6<=POSTS!$D4+POSTS!$G4+(POSTS!$G4<POSTS!$F4))))

+ 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