You can use this formula in M12

=INDEX(B$7:B$15,SMALL(IF((A$7:A$15=K12)*(C$7:C$15=L12),ROW(B$7:B$15)-ROW(B$7)+1),COUNTIF(L$12:L12,L12)))

confirmed with CTRL+SHIFT+ENTER and copied down

That will cope with duplicate values in L12:L14