NETWORKDAYS Formula

Drewmyster

Board Regular
Joined
May 16, 2007
Messages
150
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I need to use the above formula to work out the difference in days between 2 dates.

The only slight variation is that I would need it to work under some conditions;

The sheet effectively has 3 columns of data ranges, and A1 displays the current date =TODAY()

I need the formula to work out if A2 has a date, but B2 does not, to work out the networkdays A2:A1.
But
If A2 has a date AND B2 has a date, to work out the networkdays A,B.
However
If A2 has a date, B2 does not have a date, but C2 does, to work out the networkdays A,C.

I hope this makes sense.

Please advise.
 
Last edited:

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi there,

I need to use the above formula to work out the difference in days between 2 dates.

The only slight variation is that I would need it to work under some conditions;

The sheet effectively has 3 columns of data ranges, and A1 displays the current date =TODAY()

I need the formula to work out if A2 has a date, but B2 does not, leave blank.
But
If A2 has a date AND B2 has a date, to work out the networkdays A:B.
However
If A2 has a date, B2 does not have a date, but C2 does, to work out the networkdays A:C.

I hope this makes sense.

Please advise.
Something like...

=IF(ISNUMBER(A2),IF(COUNT(B2:C2)=1,NETWORKDAYS(A2,MAX(B2:C2)),""),"")
 
Upvote 0
So assuming A2 will always have a date...
And if BOTH B2 and C2 have dates, then use B2..

try
=IF(COUNT(B2:C2),NETWORKDAYS(A2,IF(B2,B2,C2),E1:E20),"")


E1:E20 is your optional range of holiday dates to exclude.

Hope that helps.
 
Upvote 0
That's very helpful thanks alot. I managed to use Aladin Akyurek's formula and it worked exactly as I had hoped for.

Many thanks.
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,415
Members
448,960
Latest member
AKSMITH

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