Link to home
Start Free TrialLog in
Avatar of Marco van Beek
Marco van BeekFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Fixing a speadsheet formula reference so that adding a row does not change it

This is probably a very simple answer, but I am pulling my hair out trying to figure it out. I am doing a spreadsheet (in OpenOffice) in which I want to calculate the sum of the last 12 months. Every month we will need to add a new row, and I don't want to have to reset the formulas each time.

Now before you all start talking about absolute cell references, I have tried that, and as you add a row, the "absolute" reference stays with the cells originally defined, so despite the new month being added, the formula still reference the old data. Now that makes a certain amount of sense to me, but I need a way of fixing the formula to a specific cell, regardless of any rows of columns that may be added to the rest of the sheet.

Named ranges move as well, so that's no use. At the moment the only thing I can see working is to cut the data and paste it one row down, which as the data set is growing by one row a month, is not a fixed target either.

Any ideas?

Marco.
Avatar of John
John
Flag of Canada image

There is a way that I use in Excel that is very low-brow.  I keep a blank row between my details and my total. The total includes the blank row. When I add a row above the blank row, the total automatically adjusts for the new row. No absolute references.  This works in Excel and I use it all the time. I do not use Open Office.

.... Thinkpads_User
what about giving a name to rows/range and use that name in your formulas? worst case you will re-difine name...

or use a range from start to end , which first 10-12 has rows (refer to 1000 rows in your formulas) and arrange the formulas/script according to these... loop until row is empty... so you will not have any issue, say until you have 1000 records...
Avatar of Marco van Beek

ASKER

Hi,

The blank row idea doesn't work because it just makes the selection bigger, and I just want 12 rows.

Ranges seem to behave the same as absolute references, and shift down and I can't do the 1000 rows because the spreadsheet has to be used by an admin person who will want to keep all the data from rows 13-1999 as they build up.

Any more ideas anyone?
You have to adjust your formulas if you do not want a blank row to help you. While I admit it is a low-brow way to do things, I use the idea all the time because it saves me time.

Can you not change the habits of the admin person?  Otherwise, you need to change formulas when you add a row. ... Thinkpads_User
ASKER CERTIFIED SOLUTION
Avatar of Marco van Beek
Marco van Beek
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
From Excel Help (I am quoting it):  Returns the reference specified by a text string. References are immediately evaluated to display their contents. Use INDIRECT when you want to change the reference to a cell within a formula without changing the formula itself.

Useage is:  Indirect(ref_text,a1)  Returns the reference specified by a text string.

I don't know if that will help here or not. ... Thinkpads_User
If you want a cell reference to stay nailed to the same row/column, regardless of adding or deleting rows and columns, use INDIRECT("C" & "3") instead of C3 or $C$3.