WORKDAY() Function with dynamic multiple holiday ranges

OzNjB

New Member
Joined
May 6, 2018
Messages
1
I am trying to develop a formula that calculates the anticipated end date of project tasks utilizing the WORKDAY(start_date, days, [holidays]) function for use in conditional formatting based on:
1) provide start date using a named range "start_date"
2) length of projects in weeks (to the nearest 0.2 to represent part weeks e.g. 4.2 equals 4 working weeks + 1 additional day or 21 days total) using a named range "task_weeks"
3) A fixed column list of public holidays for the next 2 years using a named range called "holidays" (Holidays!$B$2:$B$39)

The basic formula for this that I was using (apparently successfully) was:
=WORKDAY(task_start,task_weeks*5,holidays)

The problem is now I want to extend the holiday date ranges dynamically by adding a column list of dates of planned annual leave taken by the assigned engineer (where known at this stage)

The formula that successfully determines the cell range containing the list of known annual leave dates for a given engineer is:

INDIRECT(HLOOKUP(eng_no,eng_holiday_range,2,FALSE))

where eng_no is a named range used in formulas to return the engineer no (e.g. for Jo Bloe: eng_no = 4)
and eng_holiday_range is a 2 row table that contains eng_no values in the first row and cell column ranges applicable to that eng_no in the second row

I was blindly hoping that I could simply combine the ranges for the public holidays & known engineer annual leave dates into the WORKDAY function as:

=WORKDAY(task_start,task_weeks*5,(holidays,INDIRECT(HLOOKUP(eng_no,eng_holiday_range,2,FALSE))))

The problem is that the function returns a #VALUE ! error and so I assume that means the function can't handle a list of ranges for the [holidays] variable

Is there any way I can get this to work? Or do I have to "cheat" and simply repeat the public holiday list above each column of known individual engineer leave dates (this is doable)
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
... repeat the public holiday list above each column of known individual engineer leave dates (this is doable)
Why "above" -- you can do it way below.
Why "repeat" -- just add references to your holidays range.
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

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