excel 自动排列值班表,人员7人,每天三人值班
为了使值班人员及每天班次可自定义,所以做得公式比较麻烦,不过一劳永逸吧,我自己也能用得到,发给你看看。
值班人员如果增加,可以直接在下面增加人员,排班表自己调整,如果要增加每天的值班人的话,需要增加列,并调整公式参数。
C列(人员1)内单元格公式:
=INDEX($G$2:$G$32,IF((ROUNDDOWN((COUNTA($C$1:$E$1)*$A2-2)/COUNTA($G$2:$G$32),8)-ROUNDDOWN((COUNTA($C$1:$E$1)*$A2-2)/COUNTA($G$2:$G$32),0))=0,COUNTA($G$2:$G$32),(ROUNDDOWN((COUNTA($C$1:$E$1)*$A2-2)/COUNTA($G$2:$G$32),8)-ROUNDDOWN((COUNTA($C$1:$E$1)*$A2-2)/COUNTA($G$2:$G$32),0))*COUNTA($G$2:$G$32)))
D列(人员2)内单元格公式:
=INDEX($G$2:$G$32,IF((ROUNDDOWN((COUNTA($C$1:$E$1)*$A2-1)/COUNTA($G$2:$G$32),8)-ROUNDDOWN((COUNTA($C$1:$E$1)*$A2-1)/COUNTA($G$2:$G$32),0))=0,COUNTA($G$2:$G$32),(ROUNDDOWN((COUNTA($C$1:$E$1)*$A2-1)/COUNTA($G$2:$G$32),8)-ROUNDDOWN((COUNTA($C$1:$E$1)*$A2-1)/COUNTA($G$2:$G$32),0))*COUNTA($G$2:$G$32)))
E列(人员3)内单元格公式:
=INDEX($G$2:$G$32,IF((ROUNDDOWN((COUNTA($C$1:$E$1)*$A2)/COUNTA($G$2:$G$32),8)-ROUNDDOWN((COUNTA($C$1:$E$1)*$A2)/COUNTA($G$2:$G$32),0))=0,COUNTA($G$2:$G$32),(ROUNDDOWN((COUNTA($C$1:$E$1)*$A2)/COUNTA($G$2:$G$32),8)-ROUNDDOWN((COUNTA($C$1:$E$1)*$A2)/COUNTA($G$2:$G$32),0))*COUNTA($G$2:$G$32)))
这样的话每隔七天都是一样的,我想要的是每隔七天都来一次更换
是不是要求人员搭配不一样?