Just guessing (because I'm not sure what result you want) but maybe this in G9:

=IF(COUNTIF(E$4:E8,E9),"",ConcatIfs(",",$A$3:$A$9,$B$3:$B$9,E9,$C$3:$C$9,F9))