Not really sure why you are even using SUM, when you want a value for that row only?

Perhaps this will simplify it though...
=sumifS(F$2:F$5,D$2:D$5,H2.E$2:E$5,H$1)

AND wont work like that with a range, you need to compare 1 cell with 1 cell