=SUMIF(G12:G211;">"&B4;H12:H211).

For the second bit i will have to think about that, I am not sure exactly what you mean

Regards

Dav