Here, try this:

=SUMPRODUCT(--($D$3:$D$11="P"), --($C$3:$C$11=A19), $B$3:$B$11)