Networking Days - Different Hours on friday

NicB

New Member
Joined
Feb 15, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
HI Guys

Please help - I would like to calculate the number of hours using holiday range

We work Monday to Thursday 8 - 16:00 (1 hour already deducted for lunch)
and Fridays 7 - 13:00 (1 hour already deducted for lunch)

How do i add the friday hours?

=(NETWORKDAYS(D14,I14,$L$6:$L$20)-1)*("16:00"-"8:00")+IF(NETWORKDAYS(I14,I14),MEDIAN(MOD(I14,1),"16:00","8:00"),"16:00")-MEDIAN(NETWORKDAYS(D14,D14)*MOD(D14,1),"16:00","8:00")
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi

I have this spreadsheet layout.
1613424771512.png



You can use the following formula to work out total hours of work.


=NETWORKDAYS.INTL(A1,A13,1)*8+(COUNT(A1:A13)-NETWORKDAYS.INTL(A1,A13,16))*7


Kind regards

Saba
 
Upvote 0
Date and Time 2021.xlsm
ABCD
1
2Thu 01-Jul-21168
3Fri 02-Jul-21F168
4Sat 03-Jul-21
5Sun 04-Jul-21Daily hours8
6Mon 05-Jul-212Friday6
7Tue 06-Jul-213
8Wed 07-Jul-214No holidays
9Thu 08-Jul-215
10Fri 09-Jul-21F1
11Sat 10-Jul-21
12Sun 11-Jul-21
13Mon 12-Jul-216
14Tue 13-Jul-217
5a
Cell Formulas
RangeFormula
D2D2=NETWORKDAYS.INTL(A2,A14,"0000111")*8+NETWORKDAYS.INTL(A2,A14,"1111011")*6
D3D3=7*8+2*6
 
Upvote 0
You can add a range of Holidays to the formula.

A slightly different version is included below.

Date and Time 2021.xlsm
ABCD
1
2Thu 01-Jul-21168
3Fri 02-Jul-21F168
4Sat 03-Jul-2168
5Sun 04-Jul-21
6Mon 05-Jul-212Daily hours8
7Tue 06-Jul-213Friday6
8Wed 07-Jul-214
9Thu 08-Jul-215No holidays
10Fri 09-Jul-21F2
11Sat 10-Jul-21
12Sun 11-Jul-21
13Mon 12-Jul-216
14Tue 13-Jul-217
5a
Cell Formulas
RangeFormula
D2D2=NETWORKDAYS.INTL(A2,A14,"0000111")*8+NETWORKDAYS.INTL(A2,A14,"1111011")*6
D3D3=7*8+2*6
D4D4=NETWORKDAYS.INTL(A2,A14,1)*8-SUMPRODUCT(--(TEXT(A2:A14,"ddd")="Fri"))*2
 
Upvote 0
1613457074665.png

HI Guys

thanks so much for the feedback - unfortunately its still not calculating correctly using hours and minutes - see highlighted cell E9 is using normal weekly hours (mon - Friday 8 hours)
=(NETWORKDAYS(D14,I14,$L$6:$L$20)-1)*("16:00"-"8:00")+IF(NETWORKDAYS(I14,I14),MEDIAN(MOD(I14,1),"16:00","8:00"),"16:00")-MEDIAN(NETWORKDAYS(D14,D14)*MOD(D14,1),"16:00","8:00")
 
Upvote 0
How did you calculate the 56:11?
It will help greatly if you post a couple of example's with the forum's XL2BB.
 
Upvote 0
How did you calculate the 56:11?
It will help greatly if you post a couple of example's with the forum's XL2BB.
HI There

Ok let me try and add it - but the 56:11 is using the formula

=(NETWORKDAYS(D9,E9,$H$6:$H$20)-1)*("16:00"-"8:00")+IF(NETWORKDAYS(E9,E9),MEDIAN(MOD(E9,1),"16:00","8:00"),"16:00")-MEDIAN(NETWORKDAYS(D9,D9)*MOD(D9,1),"16:00","8:00")
 
Upvote 0
Hi

you may want to try this solution

1613518280085.png


Enter the following formula in C1

((NETWORKDAYS.INTL(A1,B1,"0000111")-1)*8/24+(NETWORKDAYS.INTL(A1,B1,"1111011")-1)*6/24)+IF(WEEKDAY(B1)=6,MEDIAN(8/24,MOD(B1,1),13/24)-MIN(8/24,13/24),MEDIAN(8/24,MOD(B1,1),13/24)-MIN(8/24,16/24))+IF(WEEKDAY(A1)=6,MAX(8/24,13/24)-MEDIAN(8/24,MOD(A1,1),13/24),MAX(8/24,16/24)-MEDIAN(8/24,MOD(A1,1),16/24))

Kind regards

Saba
 
Upvote 0
use the updated formula that takes into account Friday start and finish as shwon below.

((NETWORKDAYS.INTL((A1+1),(B1-1),"0000111"))*8/24+(NETWORKDAYS.INTL((A1+1),(B1-1),"1111011"))*6/24)+IF(WEEKDAY(B1)=6,MEDIAN(8/24,MOD(B1,1),13/24)-MIN(8/24,13/24),MEDIAN(8/24,MOD(B1,1),13/24)-MIN(8/24,16/24))+IF(WEEKDAY(A1)=6,MAX(8/24,13/24)-MEDIAN(8/24,MOD(A1,1),13/24),MAX(8/24,16/24)-MEDIAN(8/24,MOD(A1,1),16/24))


1613519055336.png


Kind regards

Saba
 
Upvote 0
Solution
Review the post that follows and then edit the alternative that you prefer for your sheet.
Your edit may include:
- calculation for work hours on the start date
- a calculation for the hours worked if the last day is Monday - Thursday.
- adding a range of dates to the formula for Holidays

The correct number of hours was not stated; this post shows 55:11.
F17 shows a decimal version; G17 and H17 show hours and minutes.

Date and Time 2021.xlsm
DEFGH
16StartEnd
175-Jan-21 17:2715-Jan-21 08:1155.18355:1155:11
5a
Cell Formulas
RangeFormula
F17F17=NETWORKDAYS.INTL(D17+1,E17-1,"0000111")*8+NETWORKDAYS.INTL(D17+1,E17-1,"1111011")*6+IF(WEEKDAY(E17,1)=6,MIN(6,(MOD(E17,1)-7/24)*24))
G17G17=NETWORKDAYS.INTL(D17+1,E17-1,"0000111")*8/24+NETWORKDAYS.INTL(D17+1,E17-1,"1111011")*6/24+IF(WEEKDAY(E17,1)=6,MIN(6,(MOD(E17,1)-7/24)))
H17H17=IF(WEEKDAY(E17)=6,MEDIAN(6/24,MOD(E17,1),13/24)-MIN(7/24,13/24))+NETWORKDAYS.INTL(D17+1,E17-1,"0000111")*8/24+NETWORKDAYS.INTL(D17+1,E17-1,"1111011")*6/24
 
Upvote 0

Forum statistics

Threads
1,214,883
Messages
6,122,077
Members
449,064
Latest member
MattDRT

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