+ Reply to Thread
Results 1 to 14 of 14

Network days

  1. #1
    Registered User
    Join Date
    10-29-2011
    Location
    South Glos
    MS-Off Ver
    Excel 2007
    Posts
    17

    Question Network days

    Is there a way of making NETWORKDAYS not count weekends and count Bank Holidays? Thanks
    Last edited by fithawk; 11-05-2011 at 12:07 PM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Network days

    By default it only excludes weekends. You have to feed it a list of other days to exclude if you require.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,706

    Re: Network days

    Can you give some examples - I'm not clear what you want to do?
    Audere est facere

  4. #4
    Registered User
    Join Date
    10-29-2011
    Location
    South Glos
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Network days

    Quote Originally Posted by daddylonglegs View Post
    Can you give some examples - I'm not clear what you want to do?
    Hi. I want to to automate the hours taken column by inserting a date (attached). Thanks

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Network days

    You're not having much luck with attachments today.

    Dom

  6. #6
    Registered User
    Join Date
    10-29-2011
    Location
    South Glos
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Network days

    Quote Originally Posted by Domski View Post
    You're not having much luck with attachments today.

    Dom
    Yer Tiz........I ope!
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Network days

    Fithawk,
    please don't quote entire posts unnecessarily - Thx

  8. #8
    Registered User
    Join Date
    10-29-2011
    Location
    South Glos
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Network days

    Quote Originally Posted by arthurbr View Post
    Fithawk,
    please don't quote entire posts unnecessarily - Thx
    Please explain. I'm new to this forum. Thanks

  9. #9
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Network days

    Worth a read.

    Dom

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,706

    Re: Network days

    Quote Originally Posted by fithawk View Post
    Yer Tiz........I ope!
    I see the attachment but I still don't know what you want to do

    Are you trying to amend the formula in column B or something else?

  11. #11
    Registered User
    Join Date
    10-29-2011
    Location
    South Glos
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Network days

    Quote Originally Posted by daddylonglegs View Post
    I see the attachment but I still don't know what you want to do

    Are you trying to amend the formula in column B or something else?
    DOM

    Many thanks for the help. I've cracked it now so will mark as solved.

  12. #12
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,905

    Re: Network days

    I have been watching this thread and now that you have solved it I would be very interested to see the answer. (The forum encourages that, so someone else doing a search to solve the same problem will find the answer.)

    I think this can be solved with a formula similar to this

    =B3-A3+NETWORKDAYS(A3,B3)-NETWORKDAYS(A3,B3,Sheet2!$A$2:$A$6)

    where Sheet2!$A$2:$A$6 has a list of bank holidays. This basically uses NETWORKDAYS to figure out the number of bank holidays in a time period. However, the bank holidays must be specified to fall on a weekday, though I guess that's a given.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  13. #13
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,706

    Re: Network days

    Quote Originally Posted by 6StringJazzer View Post
    =B3-A3+NETWORKDAYS(A3,B3)-NETWORKDAYS(A3,B3,Sheet2!$A$2:$A$6)
    Isn't that the wrong way round 6String? that version could end up with a result higher than the number of days between A3 and B3.....assuming the requirement is to count all days between A3 and B3 inclusive except holidays then I think you'd need to amend that like this

    =B3-A3+1+NETWORKDAYS(A3,B3,Sheet2!$A$2:$A$6)-NETWORKDAYS(A3,B3)

    If holidays might be at weekends then this version would work in any version of excel

    =SUMPRODUCT((COUNTIF(Sheet2!$A$2:$A$6,ROW(INDIRECT(A3&":"&B3)))=0)+0)

    ....or in Excel 2010 only you can use NETWORKDAYS.INTL function

    =NETWORKDAYS.INTL(A3,B3,"0000000",Sheet2!$A$2:$A$6)

  14. #14
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,905

    Re: Network days

    Yes ddl, I did seem to have it backwards. I am not quite following your SUMPRODUCT solution, but I'll have a look. I still curious as to what fithawk came up with.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1