尝试使用以下UDF功能。这可以直接应用于任何细胞。请看截图。
Public Function udfvlookup(a As Range, b As Range) As String
Dim findtext As String
Dim cell As Range
Dim out As Double
findtext = a.Value
For Each cell In b
If cell Like "*" & findtext & "*" Then
out = out + cell.Offset(0, 1)
End If
Next
udfvlookup = out
End Function