replace your sum() with
=SUM(INDIRECT("B"&ROW(A7)-1)-B$3)
a7 being the row at which the formula is originally inserted