Here are the formulas in according to the OP's highlighted area.
1] F4, formula copy down :
=IFERROR(INDEX(C$4:C$55,MATCH(0,INDEX(COUNTIF(F$3:F3,C$4:C$55&""),),0)),"")
2] K4, array formula copy down :
=IFERROR(INDEX(F$4:F$11,SMALL(IF(G$4:G$11=L4,ROW(G$4:G$11)-ROW(G$4)+1),COUNTIF(L$4:L4,L4))),"")
Edit : array formula , confirmed enter with SHIFT+CTRL+ENTER 3 keys together.
Regards
Bosco