Hello, I have been working on an excel sheet to calculate the hours worked on a job per month, evenly distributing the hours across the correct months according to what days work was performed on. Thanks to the help of an excel guru on here I was able to get the formula working without issue. However, I was then instructed that the hours should only be spread across work days (excluding weekends/holidays). I have tried using the NETWORKDAYS() function and I know it is possible, but I still am struggling to get the hours to sum to the correct amount.
Workdays816.png
Pictured above is a small recreation of my data with both versions of the formula. On top is the version that works without considering work days(=MAX(0,MIN(G$1,$B3+1)-MAX(F$1,$A3))/$D3*$C3). The bottom calculation is what I have come up with to try and only account for work days (=MAX(0,NETWORKDAYS(MAX(F$8,$A10),MIN(G$8,$B10))/$D10*$C10)). As shown the "Sum" of the hours is off on the latter formula whenever the hours span across 2 or more months. I have tried tweaking the formula many times but I just can't get it to work. The issue is that the formula appears to be adding an extra day to the month before whenever the fist of the month is considered. Any help is appreciated.
workdaysExampleNew.xlsx
Bookmarks