Function SomValeursSi(xCriteres As Range, xDans As Range, NumCol&)
Dim yCriteres, tabCriteres(), n&, yDans, yCol, i&, i2&, j&, j2&
SomValeursSi = 0
yCriteres = xCriteres.Value: i2 = UBound(yCriteres, 2)
n = 0
For i = 1 To i2
If Len(yCriteres(1, i)) > 0 Then
n = n + 1
ReDim Preserve tabCriteres(1 To n)
tabCriteres(n) = "/" & yCriteres(1, i) & "/"
End If
Next i
If n = 0 Then Exit Function
yDans = xDans.Value: j2 = UBound(yDans)
yCol = xDans.Offset(, NumCol).Value
For j = 1 To j2
If Len(yDans(j, 1)) > 0 Then SomValeursSi = SomValeursSi _
+ (UBound(Filter(tabCriteres, "/" & yDans(j, 1) & "/", True, vbTextCompare)) + 1) _
* yCol(j, 1)
Next j
End Function