Can I use a cell reference in the sum command?

I have a spread sheet where I enter the dates and amount of quotations sent out. A set of columns to the right of those is used to sum up the quotes for different periods of time. There is a 30 day column, a 60 day column…

Whenever I add a new quote (date, amount), I have to manually extend the range of every sum function. If I have entries down to row 50, I have to go back to each Sum(c1:c45) and change c45 to c50.

I would like to be able to put “50”, or “c50” (or anything) in a cell that would be referenced in each sum command to extend the column to the inserted reference. Say I put “c50” in Cell f2. I would like to have every sum look something like sum(c1:“f2”), where it would read c50 and extend the sum.

Is something like this possible?

Well, I went on the web elsewhere and figured it out.

The command is sum(C1:indirect(f2)). In f2 put C50. everything works.

Well, I think you have a better alternative, activating the option:
Menu/Tools/Options/LIbreOffice calc/General/Input settings - Expand references when new columns/rows are inserted.

Then inserting a row just below the last cell with data do the job.

Also there are other ways to know what is the last row with data.

=SUMPRODUCT(MAX(ROW(A2:A20)*NOT(ISBLANK(A2:A20))))
find the last row with data in A2:A20