Please try this formula.
Formula: copy to clipboard
=SUMIFS(INDEX(C7:G46,,MATCH(B3,C6:G6,0)),A7:A46,B1,B7:B46,B2)