With legacy Excel such as Excel 2013 this formula works in my sample file. The formula must be entered as an arrayformula with ctrl+shift+enter if someone doesn't work with Office 365 or Excel for the web or Excel 2024.
=SUMPRODUCT((MMULT(N(A3:A16=TRANSPOSE(M4:M6)),ROW(A1:A3)^0)*MMULT(N(B3:B16=TRANSPOSE(N4:N6)),ROW(A1:A3)^0))*C3:C16*INDEX(H3:J16,,MATCH(L4,H1:J1,0)))