Try, in H11:

=SUMPRODUCT(--(ISNUMBER(MATCH($A$12:$A$21&F11,$A$2:$A$6&$B$2:$B$6,0))),--($B$12:$B$21=G11),$C$12:$C$21)

copied down