SIMPLE EXCEL QUESTION RELATING TO DELETEING ROWS.

I am new to excel 2010, I am sure this didnt used to happen in excel 2003 but here is the problem:

I have a formula in say E10 that looks in cell E10 and E11. this works fine.
But if I delete row 11 the formula in E10 does not work anymore. seems to be putting #REF! in the formula in E10 where it references E11.
I want to be able to delete rows but other formulas referencing this row would still work. Row 12 would now be row 11 if 11 deleted.


Cheers
Rob
RobJanineAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
zorvek (Kevin Jones)Connect With a Mentor ConsultantCommented:
In tables where formulas reference cells above or below the row in which the formula resides, cell references in those formulas get mangled (set to #REF or changed to other cells in other rows) when inserting and deleting rows in the table. This happens because Excel always tries to maintain cell references when making changes to the structure of a worksheet. But this very functionality can lead to undesired results in a table that is frequently manipulated by inserting and deleting rows.

The most obvious solution to this problem is to not reference specific rows above or below the row in which the formula resides. If this is not possible then use the OFFSET function. For example, if a formula in row 6 references a cell in row 5, column A, replace the reference A5 with OFFSET(A6,-1,0). When formulas are constructed this way Excel will always leave the cell references alone when inserting and deleting rows.

So...

=(IF($B10=OFFSET(B11,1,0), (IF($E10=OFFSET(E10,1,0),"IN","OUT")),"OUT"))

Kevin
0
 
RobJanineAuthor Commented:
formula in E10:
=(IF($B10=B11, (IF($E10=E11,"IN","OUT")),"OUT"))

if i delete row 11 this is what the formula now reads:
=(IF(B10=#REF!, (IF(E10=#REF!,"IN","OUT")),"OUT"))

Cheers
0
 
RobJanineAuthor Commented:
Thanks alot Kevin, thanks for explaing the problem clearly too.

Cheers

Rob
0
All Courses

From novice to tech pro — start learning today.