I would list them in a table format like the original,
So, first add a helper column that finds and counts the matches.
In G5 enter formula:
=IF(OR(A5=$J$3,E5=$J$3),COUNT(G$4:G4)+1,"")
copied down.
Then, say in K6 enter formula:
=IFERROR(INDEX(A:A,MATCH(ROWS($K$6:$K6),$G:$G,0)),"")
copied...