+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    11-18-2009
    Location
    DE, USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Counting People Working Each Hour

    I am trying to count the number of people scheduled for each hour of the day. I have the formula below that works but when the shift starts with a time that is PM and ends with a time that is AM it will not count accurately. I often have shifts that start at 8pm and end at 2am. The formula below will not calculate properly in this instance.

    Any help wtih this would be greatly appreciated.

    =SUMPRODUCT(($B$29>=$D$5:$D$18)*($B$29<$E$5:$E$18))

  2. #2
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,140

    Re: Counting People Working Each Hour

    =sumproduct(($d$5:$d$18<=$b$29)*(mod($e$5:$e$18-$d$5:$d$18,1)>=mod($e$5:$e$18-$b$29,1)))

  3. #3
    Registered User
    Join Date
    11-18-2009
    Location
    DE, USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Counting People Working Each Hour

    Thanks for the fast response. When I put your formula in I dont get the result I am looking for. Maybe I am doing something incorrectly. I realize I didnt explain the sheet layout in the original post so I am attaching the file.

    I need the coverage chart to count the number of people working each hour even when the shift starts wtih a time in the PM and ends in a time with the AM.

    Thanks in advance for any help you can offer!

    Template Drop Down with Coverage Chart.xls

  4. #4
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,140

    Re: Counting People Working Each Hour

    That helps a little bit. Try =SUMPRODUCT(($D$5:$D$18<=B29)*(MOD($E$5:$E$18-$D$5:$D$18,1)>MOD(($E$5:$E$18-TIME(,,1))-B29,1)))

  5. #5
    Registered User
    Join Date
    11-18-2009
    Location
    DE, USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Counting People Working Each Hour

    That works great except for the midnight hour. In the schedule if I enter a start time of 8pm and and end time of 2am I need to see the value of 1 in each cell of the coverage chart for 8p-9p, 9p-10p, 10p-11p, 11p-12a, 12a-1a, 1a-2a for that day.

    So far everything I try stops short of calculating beyond the midnight hour.

    Thanks again for any help you can offer!

  6. #6
    Registered User
    Join Date
    11-18-2009
    Location
    DE, USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Counting People Working Each Hour

    Thanks Darkyam for your help. I think the issue was with the formatting of the times in column B. I deleted 12:00 AM from cell B49 and typed it in again. When I did this the formatting automatically changed to a custom format and then your formula started working. Now it works just like I need it too.

    Thanks for your time, help and patience!!!!

Thread Information

Users Browsing this Thread

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

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.2.0