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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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,213,557
Messages
6,114,293
Members
448,564
Latest member
ED38

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