Modifications onglet "À masquer" :
Colonne E :
=IFERROR(byrow(query($D$2:$D;"select * where D is not null");lambda(n;query('Matières et intervenants'!$A$4:$O;"select Col12, Col14 where Col1 = """&n&""" and Col1 is not null "))))
Colonne D :
=flatten(split(rept(textJOIN("|";FALSE;query('Matières et intervenants'!$A$4:$A;"select * where A is not null"))&"|";COUNTA(Dates_cours));"|"))
Colonne C :
=iferror(MAP($A$2:$A;$D$2:$D;lambda(m;n;query(tocol(query(transpose(arrayformula(TO_TEXT(Emploi_du_temps)));"select * where Col1 = '"&TO_TEXT(m)&"' ";0);3);"select count(Col1) where Col1 = """&n&""" label count(Col1)'' "))))
Colonne B :
=IFERROR(map('À masquer'!$A$2:$A;'À masquer'!$D$2:$D;lambda(m;n;join(" ";(query({{" ";Horaires}\transpose(query(transpose(query(arrayformula(TO_TEXT(Emploi_du_temps))));"select * where Col1 = '"&TO_TEXT(m)&"' "))};"select Col1 where Col2 = """&n&""" "))))))