You can also use =SUMIFS(H3:H6,F3:F6,B2,G3:G6,B3)