If your first table is in S1!A1:B5
and in S2
sheet you have T1;T2;T3;T4
in cell A8
try this formula for the sum
=SUMPRODUCT(ISNUMBER(SEARCH(";"&'S1'!$A$1:$A$5&";",";"&A8&";"))+0,'S1'!$B$1:$B$5)
SEARCH
searches for each value from A1:A5 surrounded by ";" signs in A8
, also surrounded by ; signs, if there's a match you get a number so ISNUMBER
returns TRUE
and SUMPRODUCT
adds the relevant value from B1:B5
SEARCH
is not case-sensitive - if you need it to be then use FIND
instead
See screenshot - shown on one sheet for simplicity but it's the same formula