I'm going crazy.
Have a look here
Get Excel Jet : work hours between dates and times
Looking at it NETWORKDAYS(end,end) and NETWORKDAYS(start,start) , as there are 0 days between end-end and start-start , should evaluate to 0 so that the formula could be reduced to
And because IF(0) -> FALSE, and MEDIAN(0, latetime, earlytime)-> earlytime (upper late time, lower = early time) shoulf further reduce to
But - it does not give the same result...
What am I not seeing here ??
Have a look here
Get Excel Jet : work hours between dates and times
VBA Code:
=(NETWORKDAYS(start,end)-1)*(upper-lower)
+IF(NETWORKDAYS(end,end),MEDIAN(MOD(end,1),upper,lower),upper)
-MEDIAN(NETWORKDAYS(start,start)*MOD(start,1),upper,lower)
Looking at it NETWORKDAYS(end,end) and NETWORKDAYS(start,start) , as there are 0 days between end-end and start-start , should evaluate to 0 so that the formula could be reduced to
Code:
=(NETWORKDAYS(start,end)-1)*(upper-lower)
+IF(0,lower,upper)
-MEDIAN(0,upper,lower)
And because IF(0) -> FALSE, and MEDIAN(0, latetime, earlytime)-> earlytime (upper late time, lower = early time) shoulf further reduce to
Code:
=(NETWORKDAYS(start,end)-1)*(upper-lower)
+ upper
- lower
But - it does not give the same result...
What am I not seeing here ??