Your ranges are inconsistent.

Shouldn't this read as
=AVERAGEIFS(E:E,G:G, R2,G:G,"<>"&R2+4)