d2
=SUM(1*(MATCH(IF($A$2:$A$100=A2,$A$2:$A$100&$B$2:$B$100,A2&B2),IF($A$2:$A$100=A2,$A$2:$A$100&$B$2:$B$100,A2&B2),)=ROW($A$1:$A$99)))
数组公式,三键结束,ctrl+shift+enter。
d2=if(a2=a3,"",sumproduct((a$2:a2=a2)*(c$2:c2>0)/countif(b$2:b2,b$2:b2)),下拉,则每个人最后出现的位置会显示其违规天数