Changing a 'NETWORKDAYS' formula to just 'DAYS'!

clairi55a

New Member
Joined
Jan 20, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello, I have a formula which is calculating the number of working hours between two dates, and it works beautfully! However, I need to amend it to include all seven days of the week, not just monday - friday. I thought it would as simple as swapping all of the 'NETWORKDAY' references to just 'DAYS'...but it doesn't work. My formula is as follows:

=IFERROR(IF(COUNTIF(RepairOnly,I2)=0,"",(NETWORKDAYS(AG2,AI2,PublicHolidays)-1)*("17:00"-"08:30")+IF(NETWORKDAYS(AI2,AI2),MEDIAN(MOD(AI2,1),"17:00","08:30"),"17:00")-MEDIAN(NETWORKDAYS(AG2,AG2)*MOD(AG2,1),"17:00","08:30")),"")

The clock should only count between the hours of 08:30-17:00, although sometimes a row of data starts/ends outside of these times, hence the moderations in the formula.

Unfortunately, my work laptop security won't let me upload a file, so I'm unsure if anyone will be able to help without a sample? I feel like it should be a simple thing to adjust this to include all days of the week (same hours), but I just can't do it!

Many Thanks in advance if someone can :)
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
You can use the networkdays.intl function like
Excel Formula:
NETWORKDAYS.INTL(AG2,AI2,"0000000",PublicHolidays)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,235
Members
449,092
Latest member
SCleaveland

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