# Networkdays Formula help

#### RankinC

##### Board Regular
Hi,

I'm hoping for some help with a networkdays formula; i've used the same formula (referencing different cells) in 2 columns and the results that it has returned are brilliant. However, i would like to expand on both formulas, individually, just to remove some small issues errors when returning data. All cells are formatted to [h]:mm:ss

The first formula is: =((NETWORKDAYS(U2,W2)-1)*("16:30"-"8:00")+MOD(W2,1)-MEDIAN(NETWORKDAYS(U2,U2)*MOD(U2,1),"8:00","16:30"))
What I would like this formula to do is return a blank value if column U is not populated; currently its is populating it with data that is irrelevant

The second forumla is the same but referencing different cells: =((NETWORKDAYS(T2,W2)-1)*("16:30"-"8:00")+MOD(W2,1)-MEDIAN(NETWORKDAYS(T2,T2)*MOD(T2,1),"8:00","16:30"))
With this formula, if the column W has a lesser value than T, I just get '##########' within the cell; is it possible to return this has a minus firgue (i.e. -04:00:00); if not then simply returning it has a 0 would be fantastic.

Thank you in adavance and a happy new year for tomorrow

Chris

### Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

#### timfritsch

##### Active Member
How about something like:

First formula:
=IF(ISBLANK(U2),"",((NETWORKDAYS(.....)))

Same concept for 2nd formula.

Tim

#### barry houdini

##### MrExcel MVP
To restrict the 2nd formula to a maximum of zero you can add a MAX function like this

=MAX(0,(NETWORKDAYS(T2,W2)-1)*("16:30"-"8:00")+MOD(W2,1)-MEDIAN(NETWORKDAYS(T2,T2)*MOD(T2,1),"8:00","16:30"))

#### RankinC

##### Board Regular
Thanks gents these worked perfectly apart from one little issue that i'm hoping can be easily resolved.

I amended the first formula to include '=if(isblank' function so it now looks like this: =IF(ISBLANK(U436),"",0+((NETWORKDAYS(U436,W436)-1)*("16:30"-"8:00")+MOD(W436,1)-MEDIAN(NETWORKDAYS(U436,U436)*MOD(U436,1),"8:00","16:30")))

What i have found is that around 10 of the returns are still returning ######; the reason being is that in some instances cell W is less than cell U. Is it possible to add and an extra function or would it be easier just manually amend these?

Thanks again

Chris

Replies
3
Views
411
Replies
33
Views
424
Replies
34
Views
480
Replies
5
Views
216
Replies
4
Views
363

Threads
1,195,582
Messages
6,010,577
Members
441,557
Latest member
Jbest23

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

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