I WAS missing something. To keep {1,2,3,4,5,6,7} uesful, we would need to multiply the number of days by weekly_holidays*(int(days/7)+1).
e.g. to make all Fridays, Saturdays, and Sundays into holidays we would use {2,3,4,5} and ABS(days)*3*(INT(days/7)+1)+COUNT(holidays).
To keep things simple, ABS(days)*2+COUNT(holidays) will cope with all circumstances. So, if I'm right, the final formula would be:
=start_date+SIGN(days)*SMALL(IF((WEEKDAY(start_date+
SIGN(days)*(ROW(INDIRECT("1:"&ABS(days)*2+COUNT(
holidays)))))={1,2,3,4,5,6,7})*ISNA(MATCH(start_date+
SIGN(days)*(ROW(INDIRECT("1:"&ABS(days)*2+COUNT(
holidays)))),holidays,0)),ROW(INDIRECT("1:"&ABS(days)*
2+COUNT(holidays)))),ABS(days))
Opinions?
Cheers
Steve D.
"StunnRocker" wrote in message news:f5adfcc0-632d-4387-8adb-c53d7bc74cfe...
Excellent formula from Bob, but rather than ABS(days)*10, ABS(days)+COUNT(holidays) should cover it, unless I'm missing something.
"Mike H.." wrote in message news:cbc1420a-8267-4f59-934d-f259049b855a...
Hi,
I'm sure Bob's perfectly capable of speaking up for his own formula but here's my understanding
I still like Bob's formula a lot. It fails in your example becuase there are more than 9 holidays in the range, I believe it would cope with 10 if the named range 'Holidays' began in row 1.
Change the 10 in this -ABS(days)*10- to a larger number and it will cope with more holidays. I tested it up to 30 holidays and it works fine
If this post answers your question, please mark it as the Answer.