Calculate working hours between two dates excluding weekends

micky666

New Member
Joined
Oct 6, 2014
Messages
5
working hours from 9:00-17:00. Excluding weekends. Have an Excel 2010.

Start Date 1/1/14 08:00
End Date: 3/1/14 11:00

Details above given in:
Date format: MM/DD/YY
24-hour time

Date and Time are in separate Tabs
i.e A1: 1/1/14
B1: 08:00
C1: 3/1/14
D1: 11:00
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
This does not work i'm not sure if it's because i have the time and date in two different tabs and i'm not sure what the square brackets means: [h]:mm
 
Upvote 0
That number format displays hours even if they are greater than 24. What formula are you using and in what way isn't it working?
 
Upvote 0
MachineFailure/EventSystem FailedSystem RestoredPart ResponsibleStart Date
DateTimeDateTimeComponentSub-ComponentDateTime
1F3/01/200411:00:003/05/20049:00 AMElectric SawMotor1/01/20048:00:00#VALUE!
2F3/08/20049:00:003/09/200411:00 AMElectric SawMotor1/01/20048:00:00
2F7/23/0416:15:007/25/043:15 AMElectric SawMotor1/01/20048:00:00

<tbody>
</tbody>
#VALUE! = =(NETWORKDAYS(I4:J4,C4:D4)-1)*("17:00"-"8:00")+MOD(C4:D4,1)-MOD(I4:J4,1)

System failed = system End
 
Last edited:
Upvote 0
Try like this:

=(NETWORKDAYS(I4,C4)-1)*("17:00"-"8:00")+D4-J4

custom format result cell as [h]:mm as previously advised
 
Upvote 0
when i did it returned #value.

I found an easier way to do it by just =(NETWORKDAYS(I4,C4)-1)*9+11 so you just get the date and X by 9 for the amount of hours in a workday + 11 for the next day.

Thanks to both of you for your help in any case. I greatly appreciate it.
 
Upvote 0
My requirement was to calculate working hours including all days in between two dates, this can be tweaked using =networkdays formula to calculate excluding weekends
A1= 01-12-2014 22:45
B1= 03-12-2014 06:45
C1= 08:00:00
D1= 20:00:00

All above is in the format "DD-MM-YYYY HH:MM:SS"

Formula
=IF((IF(MOD(B1,1)<C1,(D1+(INT(B1)-1)),(MIN(D1,MOD(B1,1))+INT(B1))))-(IF(MOD(A1,1)>D1,(C1+(INT(A1)+1)),(MAX(C1,MOD(A1,1))+INT(A1))))<0,0,((D1-C1)*(IF(MOD(IF(MOD(A1,1)>D1,(C1+(INT(A1)+1)),(MAX(C1,MOD(A1,1))+INT(A1))),1)>D1,(INT(IF(MOD(B1,1)<C1,(D1+(INT(B1)-1)),(MIN(D1,MOD(B1,1))+INT(B1))))-INT(IF(MOD(A1,1)>D1,(C1+(INT(A1)+1)),(MAX(C1,MOD(A1,1))+INT(A1))))-1),(INT(IF(MOD(B1,1)<C1,(D1+(INT(B1)-1)),(MIN(D1,MOD(B1,1))+INT(B1))))-INT(IF(MOD(A1,1)>D1,(C1+(INT(A1)+1)),(MAX(C1,MOD(A1,1))+INT(A1)))))))+(MIN(D1,MOD(IF(MOD(B1,1)<C1,(D1+(INT(B1)-1)),(MIN(D1,MOD(B1,1))+INT(B1))),1))-MAX(C1,MOD(IF(MOD(A1,1)>D1,(C1+(INT(A1)+1)),(MAX(C1,MOD(A1,1))+INT(A1))),1)))))


The cell(where formula is pasted) needs to be formatted in
Time -> Locale (Location): English(U.S) --> 37:30:55
 
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,846
Members
449,194
Latest member
HellScout

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