Getting a row and column number into a cell

In my spreadsheet I have a number of sums at the bottom that sum a row and column. If I import a number of rows (such as 48), I have to change the row and column number in the sum such as (=sum(N120:N15003) to the new row number (=N120:N15051). Of course this has to be done to each sum which is time consuming. Is there a way to enter the row and column number of the last or bottom row of new imported data into a cell such as =sum(N120:cellX) and then use it to update all the sums or is there some other way to do this. I’ve tried inserting cells but when you have to insert hundreds it is time consuming and often it doesn’t increment up the row number in the sum cells at the bottom. I’m sure people do this all the time but I can’t find anything in the web or Excel books on how this is done. Thanks for the help.

Maybe the option Menu/Tools/Options/LibreOffice calc/General - Expand references when new columns/rows are inserted, can help in your case.

Note that you still need to insert range of cells to have the range expand. Simply pasting additional data will not automatically expand the referenced range.

Inserting rows/columns/cells inside a range will always expand references. The Expand references option only makes a difference when you “add to the grid” at the edge of the range.