In P2. Copy down and across ??

=SUMPRODUCT(($A$2:$A$16=$O2)*($B$1:$M$1=P$1)*($B$2:$M$16))