Net work Hours Calculation

Keyan_rrr

New Member
Joined
May 22, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi, i have a similar question and mentioned below

Start date in F2 Column 5/13/2024 3:36:32 AM
End date in G2 Column 5/15/2024 10:38:40 AM

from start & end date time calculate the working hours from start shift day is 8pm in AX3 column to End shift day is 7am AY3 Column by excluding the weekend and holiday range AU2:AU12 need a excel formula. Thanks

Net work hours.xlsx
FGWATAUAVAWAXAY
1Start DateEnd DateOutput in HoursHoliday DateShift Start TimeShift End Time
205/06/2024 19:0005/07/2024 19:00205/01/202420:00:007:00:00
3
4
Net Work Hours
Cell Formulas
RangeFormula
W2W2=NETWORKDAYS.INTL(F2,G2,1,Holidays)-(NETWORKDAYS.INTL(F2,F2,1,Holidays)*IF(MOD(F2,1)>ET,1,(MAX(ST,MOD(F2,1))-ST)/(ET-ST))-(NETWORKDAYS.INTL(G2,G2,1,Holidays)*IF(MOD(G2,1)<ST,1,(ET-MIN(ET,MOD(G2,1)))/(ET-ST))))*(ET-ST)*24
Named Ranges
NameRefers ToCells
ET='Net Work Hours'!$AY$2W2
Holidays='Net Work Hours'!$AU$2:$AU$12W2
ST='Net Work Hours'!$AX$2W2
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Assuming your weekends are Sat and Sun. What happens on the Friday night shift? Does the shift End at 11:59:59 on Saturday, only 4 hrs of work?
How are holidays treated? Does the Monday Shift start at 00:00:00 on Monday or 20:00:00 on Sunday?
 
Upvote 0
Example:

Day 1 if the user logged at 8pm and they logged off at 7am next day then the work hour is 11
Day 2 if the user logged at 5pm and they logged off at 8am next day then the work hour is 11
Since the shift hours will start at 8pm and end in 7am in morning

if I have sum both day hours it should be 22 hrs.

Note - we have to exclude the weekend and holidays for the start to end date
 
Upvote 0
Example:

Day 1 if the user logged at 8pm and they logged off at 7am next day then the work hour is 11
Day 2 if the user logged at 5pm and they logged off at 8am next day then the work hour is 11
Since the shift hours will start at 8pm and end in 7am in morning

if I have sum both day hours it should be 22 hrs.

Note - we have to exclude the weekend and holidays for the start to end date
this does not answer my questions.
 
Upvote 0
The shift starts at 8 PM and end at 7 AM next day.
so when the shift starts at 8PM Friday it ends at 7 AM on Saturday Morning.
shift starts at 8 PM on Monday and end at 7AM the next day. I hope this clear now
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,150
Members
452,615
Latest member
bogeys2birdies

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