Для типа - 1:
=SUMPRODUCT (--($A3=Sheet1! $A$2: $A$17),--(B$2=TEXT (Sheet1! $B$2: $B$17, «mmmm»)),--($B$1=Sheet1! $F$2: $F$17), Sheet1! 2: 17)
Для типа - 2:
=SUMPRODUCT (--($A3=Sheet1! $A$2: $A$17),--(I$2=TEXT (Sheet1! $B$2: $B$17, «mmmm»)),--($I$1=Sheet1! $F$2: $F$17), Sheet1! 2: 17)