Try...........................
1] In L6, copied to P6, and all copied down :
=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(A$6:A$15)/(COUNTIFS($L$5:$L5,$A$6:$A$15,$P$5:$P5,$E$6:$E$15)=0),1)),"")
2] In M6, copied down :
=IF($L6="","",VLOOKUP($L6,$A$6:$B$15,2,0))
3] In N6, copied across to O6, then copied to Q6 and copied across & down :
=IF($L6="","",SUMIFS(C:C,$A:$A,$L6,$E:$E,$P6))
Regards
Bosco