Hi
This is my resolution with a extra column

Select Sheet2!L5:L45 and put the array formula

=IFERROR(SMALL(IFERROR((1/--('Inventory of Cards'!$F$6:$F$180=Sheet2!A2)*ROW(A6:A180)),""),ROW(A1:A180)),"")

Select Sheet2!A5:K5 and put the array formula

=IFERROR(OFFSET('Inventory of Cards'!$A$1:$K$1,Sheet2!L5-1,0),"")

Copy A5:K5 down

See the file Card Inventory Help.xlsm