I tried many variations of array formula, but could not get any to return the correct results (I'm sure someone else may get it right, but it evades me for now).
This can be done using a helper column.
In cell C1: =AND(COUNTIF($E$3:$E$7,A1),ISNUMBER(B1))
Where E3:E7 are cells holding the array of values.
The formula will return TRUE or FALSE.
Now we simply use a simple SUMIF formula: =SUMIF(C1:C26,TRUE,B1:B26)
Bookmarks