Network Days Calculations.

nparsons75

Well-known Member
Joined
Sep 23, 2013
Messages
1,254
Office Version
  1. 2016
Hi,

I am struggling to get this to work, hopefully someone can help...

In the table below I have dates (E) and results (H). During the month E5 auto updates with the current date. Based on this the Results change on a daily basis. This seems to work fine all through the month until the last day.

To simulate, change E5 to the 15/05/21 and the results will amend. They will show various details around days passed / left in the month.

At the end of the month when all days have passed I need (H8) and (H11) to read zero (0) as there are no days left...

If I select 1/07/21 in (E5) then the result in (H8, H11) should be zero (0), however, I get -2 ?

This sheet is being used in a wider document but the main functions are here.

Appreciate any help...


Book1
DEFGH
4FIRST DAY OF MONTH01/06/2021
5TODAYS DATE01/07/2021
6LAST DAY OF MONTH30/06/2021Days in Month30
7Total Days Elapsed30
8Total Days Left (inc. weekends)-2
9Working Days Available22
10Working Days Elapsed22
11Working Days Left-2
12Weekend Days + Holidays8
13% of Month Passed1
Sheet1
Cell Formulas
RangeFormula
H6H6=IFERROR(DAY(EOMONTH(E4,0)),"")
H7H7=IFERROR(E5-E4,"")
H8H8=IFERROR(NETWORKDAYS.INTL(E5,E6,"0000000",holidays),"")
H9H9=IFERROR(NETWORKDAYS(E4,EOMONTH(E4,0),holidays),"")
H10H10=IFERROR(NETWORKDAYS(E4,E5,holidays)-1,"")
H11H11=IFERROR(NETWORKDAYS(E5,E6,holidays),"")
H12H12=IFERROR(H6-H9,"")
H13H13=H10/H9
Named Ranges
NameRefers ToCells
holidays=holidays!$B$6:$B$27H8:H11
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
For H11 try
Excel Formula:
=IF(E5>E6,0,NETWORKDAYS(E5,E6,holidays))
and similar for H8
 
Upvote 0
Just replace the final part of that formula with your formula.
 
Upvote 0
Just replace the part in red with your H8 formula
Rich (BB code):
=IF(E5>E6,0,NETWORKDAYS(E5,E6,holidays))
 
Upvote 0

Forum statistics

Threads
1,215,758
Messages
6,126,696
Members
449,331
Latest member
smckenzie2016

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