Hi MGP,
See the attached file where I have applied below formula to achieve desired results.
=IFERROR(INDEX(B$1:B$8,SMALL(IF($D$1:$D$8=$I$1,ROW($D$1:$D$8),""),ROW(B1))),"")
Enter this formula with key combination: ctrl shift enter
Regards,
DILIPandey