View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Adding Day to find a next weekday

On Thu, 8 Feb 2007 11:57:01 -0800, Dolt wrote:

Ok, I am trying to create a function that does the following..
Adds X amount of days to a particular day including ALL days but returning a
result that is not a weekend or holiday.
I have a grid of dates with a vertical range of saturday dates, sunday dates
and an array of holiday dates.
Essentially, I have been trying to add, say, 60 days to a date. Then trying
to compare it with vlookup to each one of these using the vlookup's below b4
is the date, c2= 60, if its true it lists the date that matches.
=VLOOKUP(B4+C2,l4:l56,1,FALSE)
=VLOOKUP(B4+C2,A4:A56,1,FALSE)
=VLOOKUP(B4+C2,A59:e65,1,FALSE)
What I've tried to do is add 1 or 2 days to make it reach the next
non-holiday weekday date. But my syntax on the functions is not working out.
Any help is appreciated



=WORKDAY(B4+C2-1,1,holidays)

should do what you require.

If this function is not available, and returns the #NAME? error, install and
load the Analysis ToolPak add-in.

How?

On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then click
OK.
If necessary, follow the instructions in the setup program.

--ron