table.jpg

The function below in cells E2 & E3 returns the matches in multiple rows:

=IF(ISERROR(INDEX($A$1:$B$8,SMALL(IF($A$1:$A$8=$E$1,ROW($A$1:$A$8)),ROW(1:1)),2)),"",INDEX($A$1:$B$8,SMALL(IF($A$1:$A$8=$E$1,ROW($A$1:$A$8)),ROW(1:1)),2))

How to do I get the "matches" (E2 & E3) on the same row (E2, F2, etc.)? I'd like to have all possible matches listed next to each other since I have over 3000 rows of data.

OR, is there a better way to find multiple values and return the results on the same row?