我相信我已经找到了一种相当可靠的方法来计算 10 个工作日的最后期限,其中包括假期和周末。1) 计算 2 周期间是否为星期一,如果是,则仅添加 11 天(假设开始日算作 10 天期间的第 1 天)。否则,将 13 加到 10 个工作日加上两个周末(请记住,开始日期已经算作第 1 天;如果您没有将开始日期算作第 1 天,您的变量将是 12 和 14)。2) 为每个假期创建一个唯一的计算列,如果假期在该范围内,则返回值 1。3) 通过将值(周末和节假日)添加到您的开始日期来确定您的“总日期”。4) 确定您的总日期是在周六还是周日,如果是,请返回适当的天数以推迟到周一。
注意:我在这里看到的唯一挑战是假期是否将截止日期推到周末,然后将截止日期推到恰好是另一个假期的星期一。这在我的假期安排中没有发生,但它可能在你的安排中发生。此外,您每年都需要不断添加新的假期,因此需要您从头开始重新创建列数组以获得长期运行的列表。或者,您可以每年开始一个新列表。
C_Wknd =IF(TEXT(WEEKDAY([Complaint Created On]),"ddd")="Mon",11,13)
C_NYDay =IF(AND([Complaint Created On]<=DATE(2009,1,1),([Complaint Created On])+C_Wknd>=DATE(2009,1,1)),"1","0")
C_MLKDay =IF(AND([Complaint Created On]<=DATE(2009,1,19),([Complaint Created On])+C_Wknd>=DATE(2009,1,19)),"1","0")
C_MemDay =IF(AND([Complaint Created On]<=DATE(2009,5,25),([Complaint Created On])+C_Wknd>=DATE(2009,5,25)),"1","0")
C_PresDay =IF(AND([Complaint Created On]<=DATE(2009,2,16),([Complaint Created On])+C_Wknd>=DATE(2009,2,16)),"1","0")
C_IndDay =IF(AND([Complaint Created On]<=DATE(2009,7,4),([Complaint Created On])+C_Wknd>=DATE(2009,7,4)),"1","0")
C_LabDay =IF(AND([Complaint Created On]<=DATE(2009,9,7),([Complaint Created On])+C_Wknd>=DATE(2009,9,7)),"1","0")
C_ColDay =IF(AND([Complaint Created On]<=DATE(2009,10,12),([Complaint Created On])+C_Wknd>=DATE(2009,10,12)),"1","0")
C_VetDay =IF(AND([Complaint Created On]<=DATE(2009,11,11),([Complaint Created On])+C_Wknd>=DATE(2009,11,11)),"1","0")
C_ThxDay =IF(AND([Complaint Created On]<=DATE(2009,11,26),([Complaint Created On])+C_Wknd>=DATE(2009,11,26)),"1","0")
C_XmsDay =IF(AND([Complaint Created On]<=DATE(2009,12,25),([Complaint Created On])+C_Wknd>=DATE(2009,12,25)),"1","0")
C_GrossDte =[Complaint Created On]+C_Wknd+C_NYDay+C_MLKDay+C_MemDay+C_PresDay+C_IndDay+C_LabDay+C_ColDay+C_VetDay+C_ThxDay+C_XmsDay
C_EndSat =IF(TEXT(WEEKDAY(C_GrossDte),"ddd")="Sat",2,0)
C_EndSun =IF(TEXT(WEEKDAY(C_GrossDte),"ddd")="Sun",1,0)
Resolution Due =C_GrossDte+C_EndSat+C_EndSun