Let's see if this workes, Put in B4 and drag right/down, It's dynamic so you have to update the row 3 correctly. If u have latest xl then that also can be by formula only.
=IFERROR(INDEX(Sheet1!$A:$T,MATCH($A4,INDEX(Sheet1!$A:$T,,MATCH(B$3,Sheet1!$4:$4,0)-1),0),MATCH(B$3,Sheet1!$4:$4,0)),"")