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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
zorvek (Kevin Jones)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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RobJanineAuthor Commented:
Thanks alot Kevin, thanks for explaing the problem clearly too.

Cheers

Rob
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.