If I understand, try this array formula**:

=AVERAGE(IF(F2:F8=A1,G2:G8*H2:H8))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.