J
=(ESTNUM(EQUIV(F$1;$A2:$E2;0))*1)
=SI(ET(NB.SI($G$8:$G8;1)>0;G9=1);LIGNE()-MAX(($G$8:$G8=1)*LIGNE($G$8:$G8));"")
=LIGNE()-MAX(($G$8:$G24=1)*LIGNE($G$8:$G24))
=SI(ESTVIDE(G10);LIGNE()-MAX(($G$8:$G9=1)*LIGNE($G$8:$G9));
SI(ET(NB.SI($G$8:$G8;1)>0;G9=1);LIGNE()-MAX(($G$8:$G8=1)*LIGNE($G$8:$G8));""))
=SI(ESTVIDE(G8);"";SI(OU(G8=1;ESTVIDE(G9));LIGNES(G$8:G8)-SOMME(F$7:F7);0))