ok, did it all in one cell. this is basically the formula:
=(SUMIF(A2:A9,1,B2:B9))/(COUNTIF(A2:A9,1))
=(SUMIF(range_to_test, what_to_look_for, cell_to_look_in, range_to_add))/(COUNTIF(range_to_count, what_to_look_for))
the ones are levels (i had different numbers for the different levels, you put what you need). let me know if you need more info than that.
*edit to explain it a little*