Calculation errors when partial row deleted

honkin

Active Member
Joined
Mar 20, 2012
Messages
374
Office Version
  1. 2016
Platform
  1. MacOS
can anyone tell me how to have Excel behave as I expect and calculate things correctly when part of a row is deleted?

What I am referring to is having a number of columns of changing data (A - H) and then calculation columns to the right of the data (I - V). All of the calculation columns have data right down for maybe 30,000 rows and are designed so they are blank until column H has data. New entries from A - H are added daily and the calculations just occur correctly

The problem arises when part of a row in the data columns needs to be deleted. I am only deleting the row of data columns (A - H) and the calculation columns are untouched. Surely Excel is savvy enough that if the data in, let's say, row 100 from A - H is deleted and A - H in the rows below it are shifted up, that the calculation columns to the right still calculate whatever is in the columns to the left. It is maddening to constantly be faced with cells showing #REF! in them and when you look at the row in question, all the calculation cells now have #ref! in their formulas instead of the correct cell reference which they had previously. I never touched the calculation columns, so why can they not simply calculate the same cells as the original formula had?

Surely if A100 to H100 are deleted and A101 to H101 and all below, move up to replace them, that they now simply become the new A100 to H100 and so on. They can't possible move up and keep their row as 101. If they do not, then there appears to be a sever limitation being exhibited.

Is there any way to alleviate this, as the sheet will have these sorts of deletions constantly, yet it is needed that sheet calculates correctly?

I mean, rather than deleting the row, would I be best to simply highlight the data in A - H and hit delete, deleting the content and not the row and maybe have a macro which could adjust things to remove the blank row and repair any issues and get it back to calculating correctly?

Any help gladly accepted, as it is frustrating for such a high-tech app to have such a basic limitation
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Just to elaborate a bit further, as the formulas might need to be seen to assist. Calculation columns are actually M - X and data columns are A - H. Prices are added in the 4 columns in between I, J, K & L

Here is one such formula

=IF(L4980<>"",IF(AND(L4980>1,J4980<=2.5),98,IF(AND(L4980=1,J4980<=2.5),-100*J4980+100,0)),"")

What happens to this formula when the cells from A - L are deleted is all the references to column J from then on become #ref!

Could INDIRECT or INDEX be used somehow in the formula so as to have it not be affected by the partial deletion of a row? If so, how would that fit?

Thanks so much in advance
 
Upvote 0
You can workaround this "problem" using INDEX(), but it's not clear why it's necessary to do this?

If you delete part of a row N, and move up the cells below, then I'd expect the formulae:

- In the rest of row N to show #REF! errors,
- In row N+ 1 to now point to the data in Row N, i.e. your formulae won't be consistent down the columns. This will be a nightmare if you need to edit your formulae subsequently.

Excel is behaving exactly as expected. You've overwritten part of row N, hence Excel necessarily displays #REF errors.

Is there any reason you can't delete the whole row N?
 
Upvote 0
You can workaround this "problem" using INDEX(), but it's not clear why it's necessary to do this?

If you delete part of a row N, and move up the cells below, then I'd expect the formulae:

- In the rest of row N to show #REF! errors,
- In row N+ 1 to now point to the data in Row N, i.e. your formulae won't be consistent down the columns. This will be a nightmare if you need to edit your formulae subsequently.

Excel is behaving exactly as expected. You've overwritten part of row N, hence Excel necessarily displays #REF errors.

Is there any reason you can't delete the whole row N?
Hi Stephen
Thanks for your reply.
The main reason for not wanting to delete the entire row is the sheet will pass through multiple hands and it would be preferable that the calculation columns (M - X) are locked and the sheet protected. They are not at the moment while I try and resolve this issue. It's not a deal breaker, but would be preferable.
So if the normal data columns are not locked, any thoughts on how a partial row can be deleted and the partial rows below simply move up to fill the space and the formulas update? I'm open to any sort of thing to trial.
cheers
 
Upvote 0

Forum statistics

Threads
1,215,809
Messages
6,127,012
Members
449,351
Latest member
Sylvine

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top