Hi @alfont1120
The E: F validation columns are the way I used them to avoid errors in my formula. In my tests, I never received the "bad" validation, which meant that the date I never differed more than 7 hours (Saturday or Sunday).
I made an exhaustive validation beginning on 07-27-2019 until 12-31-2022 and did not detect any errors. The formula only detected errors by default and not by excess. I corrected the validation formula (I used ABS) and found that a multiple duration of 21 hours always translated into an error.
The correction of the formula follows.
If you continue to get errors, please send me the details of this situation.
Validation In E4... and F4...:
Formula:
=SUMIFS($O$2:$O$1286,$M$2:$M$1286,">="&B4,$M$2:$M$1286,"<="&D4)
=IF(ABS(E4-C4)<8,"Ok","Bad")
End_Date in D4:
Formula:
=IFERROR(IFERROR(
MATCH(C4,INDEX(8*(ROUNDDOWN((C4-1)/21,0)*7+ROW($A$1:$A$13))-7*NETWORKDAYS(B4,B4+ROUNDDOWN((C4-1)/21,0)*7+ROW($A$1:$A$13)-1),),0),
MATCH(C4,INDEX(8*(ROUNDDOWN((C4-1)/21,0)*7+ROW($A$1:$A$13))-7*NETWORKDAYS(B4,B4+ROUNDDOWN((C4-1)/21,0)*7+ROW($A$1:$A$13)-1),),1)+1)
-1+B4+ROUNDDOWN((C4-1)/21,0)*7,B4)
Note that validation is not necessary to solve your problem nor the table $M$2:$P$1286.
Bookmarks