LETが使えなければ...
B3
=SUMPRODUCT((INDEX(Sheet2!A$2:Z$100,,AGGREGATE(14,6,COLUMN(A:Z)/(Sheet2!A$2:Z$100<>""),1))=A3)
*(INDEX(Sheet1!A$2:Z$100,,AGGREGATE(14,6,COLUMN(A:Z)/(Sheet2!A$2:Z$100<>""),1))))
またはどこかのセル、例えば D1 に
=AGGREGATE(14,6,COLUMN(A:Z)/(Sheet2!A$2:Z$100<>""),1)
としておいて、
B3
=SUMPRODUCT((INDEX(Sheet2!A$2:Z$100,,D$1)=A3)*(INDEX(Sheet1!A$2:Z$100,,D$1)))