Try this in cell G6, copied down. It may need to be array-entered in Excel 2010.
Code:
=INDEX('Sheet 2'!$D$1:$D$1000,SMALL(IF((('Sheet 2'!$B$3:$B$14=$F6)*('Sheet 2'!$C$3:$C$14=$M$4))=1,ROW('Sheet 2'!$B$3:$B$14)),COUNTIF(F$6:F6,F6)))
It may not be as short as it could be but I'm having to remember what is and isn't available in your version of Excel.
Once it's working as you want, you can wrap it in an IFERROR function to hide errors.