+ Reply to Thread
Results 1 to 8 of 8

Cell reference gets disturb after inserting or deleting row

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    63

    Cell reference gets disturb after inserting or deleting row

    Dear Friends,


    I have a excel file with two worksheets. Sheet 1 is a input sheet and Sheet 2 is report sheet. The user enter the data in sheet 1 and sheet 2 generate a report based on numbers entered in sheet 1.

    The cell in sheet 2 refer to cell in sheet 1 using formula e.g =Sheet1!B5

    But if any user deleted the row or insert a new row (in sheet 1), the formula below that row get disturb (in sheet 2) and I get error #REF!

    How can I have formula (e.g =Sheet1!B5) refer to same row/cell in sheet 2 even if any row is deleted or a new row is inserted in sheet 1

    Thanks,
    Rahul

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Cell reference gets disturb after inserting or deleting row

    use INDEX (over INDIRECT)

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    the above assumes users are not deleting column B in it's entirety, if so you can expand the INDEX reference, e.g.:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    but bear in mind that it's not bullet proof... INDIRECT would be safer still, however it's Volatile so don't use it unless you have.

    If you need the reference to 5 to be dynamic let us know how you need it to adapt over your formula range (i.e. increment).

  3. #3
    Registered User
    Join Date
    12-03-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Cell reference gets disturb after inserting or deleting row

    Hi XLent,

    Thanks for your reply. The first formula (=INDEX(Sheet1!$B:$B,5) works. But I wan the row reference to be dynamic, as I have aprox 5000 rows. Kindly suggest what I need to change in the formula.

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Cell reference gets disturb after inserting or deleting row

    you need to first elaborate as to

    a) where the formula is being placed, and
    b) how it is being dragged and/or needs to adapt

  5. #5
    Registered User
    Join Date
    12-03-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Cell reference gets disturb after inserting or deleting row

    1-The formula i.e (=INDEX(Sheet1!$B:$B,5) is placed in sheet 2 in cell B5.

    2- I copy the formula (Clt+C) and past it all the way down till row 5000

    I hope I answered your question. Kindly let me know if you need any additional information.

    Thanks

  6. #6
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Cell reference gets disturb after inserting or deleting row

    OK; as long as you're not deleting rows from Sheet2, only Sheet1, the below should suffice:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-03-2019
    Location
    riyadh
    MS-Off Ver
    Office 365
    Posts
    23

    Re: Cell reference gets disturb after inserting or deleting row

    Thank you! i was having this exact same problem!!

  8. #8
    Registered User
    Join Date
    12-03-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Cell reference gets disturb after inserting or deleting row

    Thanks XLent.. your solution worked for me buddy!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 03-15-2014, 06:08 PM
  2. Inserting a cell reference into a link
    By mlferri in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-22-2013, 11:12 PM
  3. Replies: 3
    Last Post: 10-29-2013, 12:06 AM
  4. [SOLVED] Cell reference in formula changes after inserting a row
    By coreytroy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-12-2012, 12:18 AM
  5. Inserting and Resizing a picture from a cell reference
    By Geerod in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-12-2011, 08:12 AM
  6. inserting/deleting rows without registering cell change
    By aznprod517 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2009, 11:43 AM
  7. Inserting a row does not increment reference in cell
    By diguerd in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2008, 01:26 PM
  8. [SOLVED] anchor comments to cell while inserting and deleting rows
    By db55ford in forum Excel General
    Replies: 1
    Last Post: 06-16-2006, 09:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1