Networkdays Function returns incorrect result: Please help

Fi_Mac

New Member
Joined
Nov 18, 2011
Messages
4
Hello

I am trying to calculate the number of days, hours and minutes between two cells, for example the cell contents are as follows:

23/9/2014 10:00 (cell D76)

and

01/10/2014 0:00 (cell E76)

my formula/calculation is as follows:

=NETWORKDAYS(E76-D76,0)&" Days "&HOUR(MOD(E76-D76,1))&" Hour "&MINUTE(MOD(E76-D76,1))&" Minutes"

The result should be 5 days, 14 hours and 0 minutes, however, the result I get is

-5 Days 14 Hour and 0 Minutes

The formula works great apart from the fact that it should NOT be minus - can anyone assist me in where I am going wrong here please. I am using Windows 7, Excel 2010. Many thanks in anticipation of any help.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Doesn't that change make the answer 7 days, 14 hours, which is incorrect?

I think you need to subtract 1.....and make a further subtraction if the time in the start cell is greater than the time in the end cell. This formula should work consistently as long as D76 and E76 are not at the weekend

=NETWORKDAYS(D76,E76)-1-(MOD(D76,1)>MOD(E76,1))&" Days "&TEXT(E76-D76,"h"" hours ""m"" minutes""")
 
Upvote 0
hello, yes it did, duh I never noticed that! Let me try your suggestion, thanks for posting
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,109
Members
452,302
Latest member
TaMere

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