I have three columns, "type," "hours," and "quantity"

I am trying to average the product of the hours and quantity if the type matches inputted criteria.

I thought I could do this, but no success:
{=AVERAGEIF(F:2:F:8, A1, {G2:G8 * H2:H8})}

I know I could create another column with the product and then run AVERAGEIF on that column, but with my application I really would like to do it in one pass. Any ideas? Thanks!