# NETWORKDAYS Formula

#### Drewmyster

##### Board Regular
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.

Last edited:

### Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
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.

Something like...

=IF(ISNUMBER(A2),IF(COUNT(B2:C2)=1,NETWORKDAYS(A2,MAX(B2:C2)),""),"")

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.

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.

Replies
4
Views
144
Replies
3
Views
452
Replies
3
Views
269
Replies
10
Views
200
Replies
5
Views
92

1,196,250
Messages
6,014,246
Members
441,808
Latest member
xplainer

### 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.

### Which adblocker are you using?

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

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