Networkdays Formula help

RankinC

Board Regular
Joined
Apr 15, 2005
Messages
80
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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
How about something like:

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

Same concept for 2nd formula.

Tim
 
Upvote 0
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"))
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,565
Messages
6,114,338
Members
448,570
Latest member
rik81h

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