Working Hours Taken to Complete a Task

reberryjr

Well-known Member
Joined
Mar 16, 2017
Messages
714
Office Version
  1. 365
Platform
  1. Windows
I'm trying to calculate the amount of time taken to complete a task. The data I receive is a date/time stamp format. I'm wanting to establish how many working hours & minutes it takes to complete each task. I've been googling and trying different things for about 6 hours now, and I can't seem to find any articles that fit my scenario and/or make sense. Here's a small sample of the data I receive, with calculations shown in the Formula Used column and the results of said calculations in the Hours & Minutes column.

1723486293944.png
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Like this?
Use custom formatting [h]:mm in your Hour & Minute column.

Book1
ABC
1StartEndHrs & Min
27/30/2024 14:087/30/2024 14:520:44
36/25/2024 15:337/5/2024 7:41232:08
46/25/2024 15:337/5/2024 9:35234:02
Sheet1
Cell Formulas
RangeFormula
C2:C4C2=B2-A2


1723489776083.png
 
Upvote 0
Like this?
Use custom formatting [h]:mm in your Hour & Minute column.

Book1
ABC
1StartEndHrs & Min
27/30/2024 14:087/30/2024 14:520:44
36/25/2024 15:337/5/2024 7:41232:08
46/25/2024 15:337/5/2024 9:35234:02
Sheet1
Cell Formulas
RangeFormula
C2:C4C2=B2-A2


View attachment 115309
Unfortunately, that doesn't help me with reducing the total hours & minutes down to just working hours. Meaning, 6/25/24 - 7/5/24 is 7 working days. 8 hours per day * 7 days = 56 hours, which is waaaay under the 230+ hour results
 
Upvote 0
reberry How about this. You will get the number of working days, notice July 4th holiday, but those hours and minutes would be extra credit. We would need to talk more about hours and minutes.

24-08-12.xlsx
ABCD
1StartEnd
27/30/2024 14:087/30/2024 14:521
36/25/2024 15:337/5/2024 7:418
46/25/2024 15:337/5/2024 9:358
5
67/4/2024
Data
Cell Formulas
RangeFormula
D2:D4D2=NETWORKDAYS(A2,B2,$A$6)
 
Upvote 0
I have been struggling with a similar problem (due date/times in working hours). The math depends on start and end of shift, but I based it on 7:30-16:00 with a half hour break (at an unspecified time, so it will impact working hours less than one full day that overlap the break). I used Canadian holidays for the HolidayList, but you can use whatever you need.

2024-08-12.xlsx
ABCDEFGHI
1TaskStartDateTaskEndDateDaysFullWorkDaysEnd of start dayStart of End dayTotalWorkingHours
2Task130-Jul-24 14:0830-Jul-24 14:520:440030-Jul-24 16:0030-Jul-24 07:301:14
3Task225-Jun-24 15:3305-Jul-24 07:41232:0810725-Jun-24 16:0005-Jul-24 07:3048:38
4Task325-Jun-24 15:3305-Jul-24 09:35234:0210725-Jun-24 16:0005-Jul-24 07:3050:32
5Task425-Jun-24 15:3305-Jul-24 09:35234:0210725-Jun-24 16:0005-Jul-24 07:3050:32
6
7
8WorkStarts07:30
9WorkEnds16:00
10WorkHours/day08:00
11
12Holidays
131-Jan-24MonNew Year's Day (2024)
1419-Feb-24MonFamily Day (AB,NB,ON,SK)
1529-Mar-24FriGood Friday
1620-May-24MonVictoria Day
171-Jul-24MonCanada Day
185-Aug-24MonCivic Holiday
192-Sep-24MonLabour Day
2014-Oct-24MonThanksgiving
2131-Oct-24ThuHalloween
2211-Nov-24MonRemembrance Day
2325-Dec-24WedChristmas
2426-Dec-24ThuBoxing Day
251-Jan-25WedNew Year's Day (2025)
Sheet1
Cell Formulas
RangeFormula
D2:D5D2=C2-B2
E2:E5E2=INT(C2)-INT(B2)
F2:F5F2=NETWORKDAYS(S2,U2,Holidays)-1
G2:G5G2=INT(B2)+$B$9
H2:H5H2=INT(C2)+$B$8
I2:I5I2=G2-B2+C2-H2-$B$10+$B$10*F2
B10B10=B9-B8-0.5/24
B13:B25B13=TEXT(WEEKDAY(A13),"Ddd")
 
Upvote 0
I just realized I posted the one with the total hours/day at 8:00 instead of 8:30. Here's both.

2024-08-12.xlsx
ABCDEFGHIJ
1TaskStartDateTaskEndDateDaysFullWorkDaysEnd of start dayStart of End dayTotalWorkingHours
2Task130-Jul-24 14:0830-Jul-24 14:520:440030-Jul-24 16:0030-Jul-24 07:301:140:44
3Task225-Jun-24 15:3305-Jul-24 07:41232:0810725-Jun-24 16:0005-Jul-24 07:3048:3851:38
4Task325-Jun-24 15:3305-Jul-24 09:35234:0210725-Jun-24 16:0005-Jul-24 07:3050:3253:32
5Task425-Jun-24 15:3305-Jul-24 09:35234:0210725-Jun-24 16:0005-Jul-24 07:3050:3253:32
68:00h day8:30h day
7
8WorkStarts07:30
9WorkEnds16:00
10WorkHours/day08:0008:30
Sheet1
Cell Formulas
RangeFormula
D2:D5D2=C2-B2
E2:E5E2=INT(C2)-INT(B2)
F2:F5F2=NETWORKDAYS(S2,U2,Holidays)-1
G2:G5G2=INT(B2)+$B$9
H2:H5H2=INT(C2)+$B$8
I2:I5I2=G2-B2+C2-H2-$B$10+$B$10*F2
J2:J5J2=G2-B2+C2-H2-$C$10+$C$10*F2


Here's the one I was struggling with, so you can see the (very unwieldy) way I did it in the end: Calculate end date and time excluding non-work hours
 
Upvote 0
Another option. You will need to change cells E3 and F3 to match your start and end days for hours worked each day and
holiday column.

Book1
ABCDEFGH
1Work DayHoliday
2StartEnd7/4/2024
3StartEndTime Worked8:0016:0012/25/2024
47/30/2024 14:087/30/2024 14:520:44
56/25/2024 15:337/5/2024 7:4148:27
66/25/2024 15:337/5/2024 9:3550:02
78/1/2024 11:008/5/2024 15:0220:02
88/1/2024 11:008/1/2024 15:004:00
912/24/2024 15:0012/26/2024 13:006:00
Sheet3
Cell Formulas
RangeFormula
C4:C9C4=(NETWORKDAYS(A4,B4,$H$2:$H$3)-1)*($F$3-$E$3)+IF(NETWORKDAYS(B4,B4,$H$2:$H$3),MEDIAN(MOD(B4,1),$F$3,$E$3),$F$3)-MEDIAN(NETWORKDAYS(A4,A4,$H$2:$H$3)*MOD(A4,1),$F$3,$E$3)


This link explains formula.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,867
Messages
6,175,062
Members
452,610
Latest member
Sherijoe

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