+ Reply to Thread
Results 1 to 4 of 4

Is there a faster way to check holidays NETWORKDAYS() replacement

  1. #1
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Is there a faster way to check holidays NETWORKDAYS() replacement

    I wrote this routine for a spreadsheet I am working on, but I'm not sure that its the fastest way, it emulates networkdays exactly, but since i cant guarantee that function will be available I wrote this function.

    I was wondering if anybody had any ideas on speeding up the holiday checking, while maintaining compatibility with the networkdays function.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Is there a faster way to check holidays NETWORKDAYS() replacement

    Good afternoon squiggler47
    Quote Originally Posted by squiggler47 View Post
    I was wondering if anybody had any ideas on speeding up the holiday checking, while maintaining compatibility with the networkdays function.
    Chip Pearson has a page dedicated to what he calls "A Better NETWORKDAYS" here. He shows how to use array formulae to emulate the NETWORKDAYS function, but goes a step further whereby you can declare any days as holidays to exclude from the calculation.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Is there a faster way to check holidays NETWORKDAYS() replacement

    The problem is chips array formula isnt compatible with NETWORKDAYS

    :-
    My code returns the same as networkdays except for the following senarios, which I assume is due to the difference in visual basic's handling of dates in 1900

    Start-------End----------Network Days--WorkingDays------Chips array
    18/04/2009 -08/05/2009------13-----------13---------------13
    08/05/2009 18/04/2009 -----[-13]--------[-13]--------------#N/A
    29/02/1900 08/04/2064-----42813------ 42813----------- 42813
    08/04/2064 29/02/1900 ---[-42813]----[-42813]------------#N/A
    00/01/1900 00/01/1900 ------0---------- 0------------#N/A
    06/01/1900 20/01/1900------11------------11---------------11
    00/01/1900 00/01/1900------ 0-------------0-----------------#N/A
    01/01/1900 01/01/1900------ 0------------[-5]----------------- 0
    02/01/1900 02/01/1900-------1------------1----------------0
    03/01/1900 03/01/1900-------1------------1-----------------1
    29/02/1900 29/03/1900 ------22-----------22----------------22
    01/01/1900 03/01/1900-------2-----------[-3]---------------1
    [BLANK ] [blank ]-------0------------0--------------#N/A
    Fred--------03/01/1900------#VALUE!---#VALUE!---------#N/A
    999999999 999999999 --------#NUM!-----#VALUE!----------1

  4. #4
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Is there a faster way to check holidays NETWORKDAYS() replacement

    after ironing out some bugs :-

    I tested it against network days and in all the cases I could come up with it returns the same values, I just cant help thinking that the holidays could be optimized since it would have to scan the whole list of a range even if most of it was blank! (i tried it with holiday list =$b:$b, it took 4.5 seconds as against networkdays 0.7 seconds)(1m items in holiday list))

    any ideas on speeding up, without loosing compatibility with NETWORKDAYS?



    Please Login or Register  to view this content.

+ 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