Calculate Total Employee Hours Worked By The Hour

mitchande21

New Member
Joined
Jun 18, 2018
Messages
2
I am having trouble finding an efficient way to manage this. What I am looking to do is find a way to calculate the total number of hours worked by employees for each hour during the day. There is an example of how the schedule exports to excel in a table below.

I want to find out how many hours are being worked from 7:00 to 8:00, 8:00 to 9:00, etc. By calculating manually, Employee 1 works for 1 hour during the 7:00 hour and employee 2 works for 15 minutes during the 7:00 hour so the total number of hours worked for the 7:00 hour is 1.25. Total hours worked for the 8 o'clock hour is 1.75. etc. How could I make excel calculate this for each hour throughout the day while taking into account when employees are off as well (ex. Employee 2 only works for 15 minutes during the 1:00 hour)

Thanks for any help here!
Employee
Time In
Time Out
Shift Length
Employee 1
7:00 AM
12:00 PM
5
Employee 2
7:45 AM
1:15 PM
5.5
Employee 3
8:30 AM
2:00 PM
5.5
Employee 4
10:00 AM
2:00 PM
4
Employee 5
10:00 AM
3:00 PM
5
Employee 6
12:00 PM
4:15 PM
4.25
Employee 7
12:15 PM
6:00 PM
5.75
Employee 8
1:00 PM
7:00 PM
6
Employee 9
3:00 PM
8:00 PM
5

<tbody>
</tbody>
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Thanks for any help here!
EmployeeTime InTime OutShift Length
Employee 17:00 AM12:00 PM5
Employee 27:45 AM1:15 PM5.5
Employee 38:30 AM2:00 PM5.5
Employee 410:00 AM2:00 PM4
Employee 510:00 AM3:00 PM5
Employee 612:00 PM4:15 PM4.25
Employee 712:15 PM6:00 PM5.75
Employee 81:00 PM7:00 PM6
Employee 93:00 PM8:00 PM5

<tbody>
</tbody>


Sounds like you are still beginning, so I figured some structure questions may help. Can you modify the table or create another worksheet?

You could run a pivot table, which may be your best answer, but it would require some structure changes as well to include your time blocks to display. I could also easily see a 24 hour calendar, grabbing values by time slots, would that work? You could do so with a macro or with cell formulas.

For example, I have a sheet which reports capacity for production during a specified time. Here is the formula in case you want to look at it. I've got a thing and will be back later.

Code:
=SUMIFS(Working_Dispatch!$H:$H,Working_Dispatch!$A:$A,">="&$C$26,Working_Dispatch!$A:$A,"<="&$D$26,Working_Dispatch!$B:$B,C7)

You would put this in a time block area, and compare it to each employee.

Alternately, you can also build a calendar for the year (not as hard as it seems), or do it by month, or financial month, and layout employee schedule like that. I like to build some of these 'larger' tables
 
Upvote 0
You're right, I am pretty new to excel and usually just fumble my way through until I find a way to get what I need to work. The table can be modified and another worksheet can be used. I have got to the point where I am able to tell how many employees are working during any given hour by using something similar to the example below:

ABCDEF
1EmployeeStartEndFrom10:00 AM
2Employee110:00 AM4:00 PMTo11:00 AM
3Employee211:00 AM2:00 PMSumproduct3
4Employee38:00 AM10:00 AMCountifs3
5Employee49:00 AM6:00 PM
6Employee510:30 AM7:00 PM
7Employee611:30 AM8:00 PM

<colgroup style="width: auto;"><col style="width: auto;"><col style="width: auto;"><col style="width: auto;"><col style="width: auto;"><col style="width: auto;"><col style="width: auto;"><col style="width: auto;"></colgroup><thead style="width: auto;">
</thead><tbody style="width: auto;">
</tbody>
Sheet2

Worksheet Formulas
CellFormula
F3=SUMPRODUCT(--(B2:B7<F2),--(C2:C7>F1))
F4=COUNTIFS(B2:B7,"<"&F2,C2:C7,">"&F1)

<thead style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; color: rgb(34, 34, 34); font-family: Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size: 13px; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: 400; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</thead><tbody style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; color: rgb(34, 34, 34); font-family: Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size: 13px; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: 400; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</tbody>

<tbody style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; color: rgb(34, 34, 34); font-family: Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size: 13px; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: 400; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</tbody>


However, I am still coming up blank on how to calculate the amount of time worked during every hour since the formula I'm using gives the same value to somebody working 60 minutes during the hour as somebody who works 1 minute during the hour. Is there a way I could get it to calculate as 61 minutes for the hour?

Thanks for the help! I feel like I'm getting on the right track; it's just a bit above my level of understanding at the moment, but I'm learning! :)
 
Upvote 0
Still stuck on this? Any way we can use a macro? I find it easier to manipulate data outside of a single cell reference. If not, we will get through it.

basically, just thinking out loud here in some psuedo code

if (TimeIn mod 60) <>0
'there is a remainder
TimeWorked = TimeWorked+Minutes(TimeIn)
Else
TimeWorked = TimeWorked+1

let me know where you are at, it's been a long time since i looked, at this, very sorry!
 
Upvote 0

Forum statistics

Threads
1,215,463
Messages
6,124,965
Members
449,201
Latest member
Jamil ahmed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top