Make formulas adjust after inserting rows

I have several formulas like this:

=SUM(C15:C20)

After I insert rows I want it to change to this:

=SUM(C15:C26)

Is there an easy way to make it auto adjust to this? I always have to go in there and manually change it. Is there an easier or automatic way to do this?

Where do you insert the rows?

Do you insert the rows a) before C15, b) after C20, or c) in between C15 and C20? If c, then @mikekaganski’s answer is not needed.

Look at Options > LibreOffice Calc > General; see Expand references when new columns/rows are inserted.

Did you mean C20 to C26? While in formula, on C15, hit F4, absolutes C15 to $C$15. $ meaning it will never change when moved,or rows inserted. C20 to $C20. C will stay the same, 20 will change.

@MarkMcLean: if OP inserts rows when on row 17, then the behaviour is as OP described; if the insertion is when cursor is on row 10, then it’s as you say. No mistake in OP’s description.

I didn’t know that. Nor did I know about your 1st.comment about options. Glad I put this in comments and not answer!! I will play with both, later. Thanks Mike.

Details are at Inserting a row changes formulas - #2 by AlexKemp.