A列是全部日期
B2=TEXT(WEEKDAY(A2,1),"aaaa"),槐察往下拖清明数
C2手填
C3=INDEX($H$1:$H$15,SUMPRODUCT(0+($F$2:$F$15=B3),0+($G$2:$G$15=C2),ROW($H$2:$H$15))),往下拖
D2=IF(AND(WEEKDAY(A2,1)>答首2,WEEKDAY(A2,1)<6),IF(C2="A","B","A"),IF(C2="A","A","B")),往 下拖
F到H列是排班的清单参考表,可以按我写的
K1和K2是查询班次的起止日期
K5=COUNTIFS($A:$A,">=" &$K$1,$A:$A,"<=" &$K$2,C:C,"=A"),往 右拖
K6=COUNTIFS($A:$A,">=" &$K$1,$A:$A,"<=" &$K$2,C:C,"=B"),往 右拖
本例没有做节假日,节假日需要手动改一下,后续会自动变化的