View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Allen Lance Allen Lance is offline
external usenet poster
 
Posts: 7
Default NETWORKDAYS thru 2020

Steve,

The easiest solution I can think of is running through a loop
mathematically to identify the Saturdays and Sundays. Start somewhere
like last Saturday then cycle through one week at a time adding 7 days
to identify all the Saturdays and 8 days to identify all the Sundays.
Adding them to a collection as you go. There aren't that many
holidays that eliminate work these days so you could choose to
identify those manually. Once you get rid of the 1352 Sat/Sun dates
over the next 13 years you're job looks a lot more manageable. A loop
can help you tie up the static holidays like new years and Christmas.
The non-static dates like Thanksgiving can be done with a little math
and a few variables. If you load all of these dates into an Array
then you can utiltize them in that function.

HTH

Allen