Formula - Always reference cell above

Ok, so I have searched and searched and cannot for the life of me find an answer to this one.


I have a formula that I have in a Numbers spreadsheet - for example in cell E3 I have E2+C3-D3. I have copied that down throughout the entire E column. The problem is that when I add rows in afterwards, the cell references are then off. So, I have in E10: E9+C10-D10. If I add a row above E10, the formula now in E11 is E9+C11-D11, offsetting the correct formula by one column. Is there a way to construct a formula that is essentially this: cell above current cell + cell 2 to the left - cell 1 to the left? That way when I add rows in anywhere it won't matter.

MacBook Pro 15", 10.14

Posted on Feb 15, 2019 12:39 PM

Reply
5 replies

Feb 15, 2019 1:04 PM in response to jrdeveraux

this is an issue in all spreadsheet programs. You will have the same issue when you go to delete a row in the middle somewhere, it will break all formulas below that refer to the row above.


There is no quick and easy fix in a spreadsheet for this. they did make sure that if you sort your data, the formulas will stay in place, referencing the cells they should. (this was actually fixed in an earlier version)

we can take advantage of that to fix your issue.


I normally have a column that i can sort by, like date or time. If you dont just make a new column that counts by ten.

Now enter the new row at the bottom of the data set with the new date, time por a number that falls between the two rows you want it to go.


now sort to put the row in the proper place. You should see your formulas fall in line nicely.


Follow the reverse to delete a row. Make its sort column value really large, sort, then delete the last row.


Jason




Feb 15, 2019 5:15 PM in response to jrdeveraux

I have E2+C3-D3. I have copied that down throughout the entire E column


It sounds as if you want a running balance in column E, something like this:




Rather than using OFFSET–which is a "volatile" function that recalculates every time you make a change in your document, no matter where or how small, and thus can lead to sluggish performance–another approach is to use simple SUM functions containing an "expanding range" (the top cell of the range is anchored by a $ whereas the bottom cell is not anchored, so when you fill the formula down the range expands). It would look like this, and produces identical results, yet is not affected by addition or deletion of rows.



The formula in E2, filled down, is:


=SUM(C$1:C2)−SUM(D$1:D2)



SG

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Formula - Always reference cell above

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.