Assuming you enter Arsenal in H1, then to get Sum of last 5 Home games...
![]()
=SUM(IF($C$2:$C$381=$I1,IF(ROW($C$2:$C$381)>=LARGE(IF($C$2:$C$381=$I1,ROW($C$2:$C$381)),5),E$2:E$381)))
confirmed with CTRL+SHIFT+ENTER not just ENTER.
copy to next column cell to get last 5 away sum.
Bookmarks