That should just be a simple SUMIF

=SUMIF(A1:A10,"*"&Sheet1!A1&"*",B1:B10)