Try the following...
A2:J10
[TABLE="width: 640"]
<tbody>[TR]
[TD="class: xl63, width: 64"]T456[/TD]
[TD="class: xl63, width: 64, align: right"]100[/TD]
[TD="class: xl63, width: 64"]A31[/TD]
[TD="class: xl63, width: 64"]T485[/TD]
[TD="class: xl63, width: 64, align: right"]4[/TD]
[TD="class: xl63, width: 64"]A11[/TD]
[TD="class: xl63, width: 64"][/TD]
[TD="class: xl63, width: 64"]A31[/TD]
[TD="class: xl63, width: 64, align: right"]5[/TD]
[TD="class: xl63, width: 64, align: right"]100[/TD]
[/TR]
[TR]
[TD="class: xl63"]T456[/TD]
[TD="class: xl63, align: right"]4[/TD]
[TD="class: xl63"]A21[/TD]
[TD="class: xl63"]T485[/TD]
[TD="class: xl63, align: right"]400[/TD]
[TD="class: xl63"]A31[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63, align: right"]400[/TD]
[/TR]
[TR]
[TD="class: xl63"]T456[/TD]
[TD="class: xl63, align: right"]6[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"]T485[/TD]
[TD="class: xl63, align: right"]6[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63, align: right"]200[/TD]
[/TR]
[TR]
[TD="class: xl63"]T456[/TD]
[TD="class: xl63, align: right"]200[/TD]
[TD="class: xl63"]A31[/TD]
[TD="class: xl63"]T485[/TD]
[TD="class: xl63, align: right"]4[/TD]
[TD="class: xl63"]A11[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63, align: right"]300[/TD]
[/TR]
[TR]
[TD="class: xl63"]T456[/TD]
[TD="class: xl63, align: right"]4[/TD]
[TD="class: xl63"]A21[/TD]
[TD="class: xl63"]T485[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63"]A41[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63, align: right"]500[/TD]
[/TR]
[TR]
[TD="class: xl63"]T456[/TD]
[TD="class: xl63, align: right"]6[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"]T485[/TD]
[TD="class: xl63, align: right"]6[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"]T456[/TD]
[TD="class: xl63, align: right"]300[/TD]
[TD="class: xl63"]A31[/TD]
[TD="class: xl63"]T485[/TD]
[TD="class: xl63, align: right"]500[/TD]
[TD="class: xl63"]A31[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"]T456[/TD]
[TD="class: xl63, align: right"]4[/TD]
[TD="class: xl63"]A21[/TD]
[TD="class: xl63"]T485[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63"]A41[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"]T456[/TD]
[TD="class: xl63, align: right"]6[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"]T485[/TD]
[TD="class: xl63, align: right"]6[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
</tbody>[/TABLE]
Code:
J2, confirmed with CONTROL+SHIFT+ENTER, and copied down:
=IF(ROWS(J$2:J2)<=$I$2,OFFSET(INDIRECT(TEXT(SMALL(IF($C$2:$F$10=$H$2,(ROW($C$2:$F$10)*10^5)+COLUMN($C$2:$F$10)),ROWS(J$2:J2)),"R0C00000"),0),0,-1),"")
Actually, we can avoid using the volatile functions OFFSET and INDIRECT...
Code:
J2, confirmed with CONTROL+SHIFT+ENTER, and copied down:
=IF(ROWS(J$2:J2)<=$I$2,INDEX($A:$F,INT(SMALL(IF($C$2:$F$10=$H$2,(ROW($C$2:$F$10)*10^5)+COLUMN($C$2:$F$10)),ROWS(J$2:J2))/10^5),MOD(SMALL(IF($C$2:$F$10=$H$2,(ROW($C$2:$F$10)*10^5)+COLUMN($C$2:$F$10)),ROWS(J$2:J2)),10^5)-1),"")
Hope this helps!