Try,
In D12, formula copied across and down:
=SUM(ISNUMBER(OFFSET($C$2,MATCH($C12,$C$3:$C$8,0),6,,25))*(OFFSET($C$2,MATCH($C12,$C$3:$C$8,0)+2,6,,25)=D$11))
Or,
=SUM(OFFSET($C$2,MATCH($C12,$C$3:$C$8,0),6,,25)*(OFFSET($C$2,MATCH($C12,$C$3:$C$8,0)+2,6,,25)=D$11))
Remark: please confirm which...