The Arrayformula into the header solves this problem.
={"Cellname";ARRAYFORMULA(IF(ISBLANK($F7:F);IF(ISBLANK($G7:G);"";ROUND(($H7:H-$G7:G)*10000;2));ROUND(($F7:F-$H7:H)*10000;2)))}