I have this formula here:
=IFERROR(IF(D4<=0,0+(VLOOKUP(A4,\'Civil Maintenance\'!A5:C46,3,FALSE)),_
C4+(VLOOKUP(A4,\'Civil Maintenance\'!A5:C46,3,FALSE))),\"0\
What you are after is called relative/absolute cell referencing. In Excel, a $ sign locks the row or column.
=A1 dragged down becomes =A2 and dragged to the right becomes =B1 This is a relative cell reference.
=$A1 dragged down becomes =$A2 and dragged to the right stays =$A1 because the column is locked with the $ sign. The column reference is absolute and the row reference is relative.
=A$1 dragged down stays =A$1 because the row number is locked, dragged to the right it becomes =B$1 . The column reference is relative and the row reference is absolute.
And, finally =$A$1 can be dragged in any direction and will stay =$A$1, because both row and column are locked with the $ sign. This is an absolute reference.
Does that make it clearer?
Without the context of your data and what the formula is supposed to do, it's hard to tell which references in your formula should be locked for rows, columns, both, or neither, but with the info above you should be able to work that out.