For Type1:
=SUMPRODUCT(--($A3=Sheet1!$A$2:$A$17),--(B$2=TEXT(Sheet1!$B$2:$B$17,"mmmm")),--($B$1=Sheet1!$F$2:$F$17),Sheet1!$C$2:$C$17)
For Type2:
=SUMPRODUCT(--($A3=Sheet1!$A$2:$A$17),--(I$2=TEXT(Sheet1!$B$2:$B$17,"mmmm")),--($I$1=Sheet1!$F$2:$F$17),Sheet1!$C$2:$C$17)