[B10]=SUMPRODUCT(($B$3:$F$5)*($B$2:$F$2=B$9)*($A$3:$A$5=$A14))
Copy down and across
However, this will result in Zero at intersections that don't exist. of course, you could put an IF statement around it to turn it to blank if not found.
And if you want blanks to appear as blank on the MATCH condition (e.g., if no P is there, you want blank, not zero), then use this:
[b10]=IF(OR(ISERROR(MATCH($A10,$A$3:$A$5,0)),ISERROR(MATCH(B$9,$B$2:$F$2,0))),"",IF(INDEX($B$3:$F$5,MATCH($A10,$A$3:$A$5,0),MATCH(B$9,$B$2:$F$2,0))=0,"",INDEX($B$3:$F$5,MATCH($A10,$A$3:$A$5,0),MATCH(B$9,$B$2:$F$2,0))))
=IFERROR(IF(INDEX($B$3:$F$