Option Explicit
Function uSUMIF(LookupRange As Range, Dat As Date, Hang As Variant) As Double
Dim Clls As Range, Col As Byte
Col = LookupRange.Columns.Count - 2
For Each Clls In LookupRange.Cells(1, 1).Resize(LookupRange.Rows.Count)
If Clls.Value = Dat And Clls.Offset(, 1).Value = Hang Then _
uSUMIF = uSUMIF + Application.WorksheetFunction.Sum(Clls.Offset(, 2).Resize(, Col))
Next Clls
End Function