Here is a formula approach which is rather complex, but seems to work. 1. Assume your start date is in A1, and your list of holidays in C1:C10. Also assume that there can be a max of 3 holidays in any 35 consecutive days. then in D1 enter the following
array** formula:
=IF(ISERR(SMALL(IF((C$1:C$10>=A$1)*(C$1:C$10<=A$1+40),C$1:C$10,""),ROW(A1))),"",SMALL(IF((C$1:C$10>=A$1)*(C$1:C$10<=A$1+40),C$1:C$10,""),ROW(A1)))
and copy it down 3 cells. (the holidays we will look at are in column D.) ** Array formula means you enter it by pressing Shift+Ctrl+Enter rather than Enter.
In cell A2 we calculate the end date with the following array** formula:
=A1+SMALL(IF((((A1+ROW(1:35))<>D$1)+((A1+ROW(1:35))<>D$2)+((A1+ROW(1:35))<>D$3)=3)*ROW(1:35)>0,(((A1+ROW(1:35))<>D$1)+((A1+ROW(1:35))<>D$2)+((A1+ROW(1:35))<>D$3)=3)*ROW(1:35),""),31)-1
If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Cheers, Shane Devenshire