sleepyshan2
New Member
- Joined
- Jul 17, 2009
- Messages
- 3
Hello,
I have searched for hours and hours for a solution to no avail, so I'm hoping the experts here can help me figure this out!
I'm trying to calculate a start date, given an end date, lead time and holiday list, but including Saturdays as a workday.
For example,
A1 = End Date, such as 8/14/2009
B1 = lead time days, such as 4 days (I need to be able to calculate beyond a single week though, currently 4, 8 and 16 days lead time)
holidays = named range "holidays" from different worksheet/tab
desired results:
if A1 is 8/14/09 and B1 is 4, 8/10/09
if A1 is 8/11/09 and B1 is 4, 8/6/09
if A1 is 7/7/09 and B1 is 4, 7/1/09 (given that 7/4/09 is in holidays named range)
Without the Saturday factor, I would use the following formula:
=WORKDAY(A1,-B1,holidays)
I've found the following array formula that is a great alternative to WORKDAY when including Saturdays, and it works great for adding to the date in A1, but if I put a negative number in B1 in this formula, it gives a #REF! error, and I don't follow the logic clearly enough to adjust myself
{=A1+SMALL(IF((WEEKDAY(A1+ROW(INDIRECT("1:"&B1*10)))>1)*ISNA(MATCH(A1+ROW(INDIRECT("1:"&B1*10)),holidays,0)),ROW(INDIRECT("1:"&B1*10))),B1)}
It does not matter to me whether the negative/subtraction is built into the formula or entered in B1 as "-4"
Can anyone help me?
I have searched for hours and hours for a solution to no avail, so I'm hoping the experts here can help me figure this out!
I'm trying to calculate a start date, given an end date, lead time and holiday list, but including Saturdays as a workday.
For example,
A1 = End Date, such as 8/14/2009
B1 = lead time days, such as 4 days (I need to be able to calculate beyond a single week though, currently 4, 8 and 16 days lead time)
holidays = named range "holidays" from different worksheet/tab
desired results:
if A1 is 8/14/09 and B1 is 4, 8/10/09
if A1 is 8/11/09 and B1 is 4, 8/6/09
if A1 is 7/7/09 and B1 is 4, 7/1/09 (given that 7/4/09 is in holidays named range)
Without the Saturday factor, I would use the following formula:
=WORKDAY(A1,-B1,holidays)
I've found the following array formula that is a great alternative to WORKDAY when including Saturdays, and it works great for adding to the date in A1, but if I put a negative number in B1 in this formula, it gives a #REF! error, and I don't follow the logic clearly enough to adjust myself
{=A1+SMALL(IF((WEEKDAY(A1+ROW(INDIRECT("1:"&B1*10)))>1)*ISNA(MATCH(A1+ROW(INDIRECT("1:"&B1*10)),holidays,0)),ROW(INDIRECT("1:"&B1*10))),B1)}
It does not matter to me whether the negative/subtraction is built into the formula or entered in B1 as "-4"
Can anyone help me?