Change the references from relative to absolute. I didn't check the formula for accuracy just the references so that you can fill down without the references changing:
Formula:
=IF(OR(G9=0,F9="A"),SUM($C$5:$F$5,$H$5:$J$5),IF(OR(G9="A",F9=0),SUM($C$5:$E$5,$G$5:$J$5)))
Bookmarks