+ Reply to Thread
Results 1 to 22 of 22

Cell reference when inserting rows?

  1. #1
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    323

    Cell reference when inserting rows?

    Hi,
    Greetings for all!

    I have a formula at Sheet2 as ...something(from this beautiful forum)..Sheet1!$A$2...

    When I insert 10 rows in Sheet1, formula in Sheet2 changes into ....Sheet1!$A$12..

    How to prevent/fix formula to $A$2, how to fixate it to A2

    Thank You in advance!!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Cell reference when inserting rows?

    You could try changing it to INDEX(Sheet1!A:A,2)
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    323

    Re: Cell reference when inserting rows?

    Quote Originally Posted by TMS View Post
    You could try changing it to INDEX(Sheet1!A:A,2)
    Could not. Coupe of thousands rows, so, slow calculation.
    Cannot, also, use volatile ADDRESS, CELL, INDIRECT, they ask "Do you want to save changes...

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,181

    Re: Cell reference when inserting rows?

    For a cou-le of thousand rows:

    =INDEX(Sheet1!A$1:A$2500,2)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Cell reference when inserting rows?

    "Thanks for the suggestion", maybe?

    Not sure why it would be slow as the row index is fixed.

    Whatever, you could try putting INDEX(Sheet1!A:A,2) in a cell on Sheet2 and referring to that instead.

  6. #6
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    323

    Re: Cell reference when inserting rows?

    And what about range? Sheet1!$A$2:$A$11?? Maybe, INDEX(Sheet1!A$1:A$2500,{2,3,4,5,6,7,8,9,10,11}) right??

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Cell reference when inserting rows?

    I have no idea what the original formula was, what the worksheets and data are like, or what you are trying to do.

    You have a couple of solutions, and your own idea based (presumably) on what has been proposed. I suggest that you test them out

  8. #8
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    323

    Re: Cell reference when inserting rows?

    For my relatively complicated problem, Excel 2013 version, is to use INDEX(whole column,2):INDEX(whole column,counta(whole column)). The condition was because I didn't want OFFSET, ADDRESS or similar, also the data set is not a table, also, the data set is updated daily with new data that is in the first 10 rows and everything below the row 3000 is deleted. THANK YOU all for your interest and love for Excel
    Please Login or Register  to view this content.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Cell reference when inserting rows?

    You're welcome.

    I would recommend you use the same column to determine the range size for all ranges. This ensures a consistent row count. You need to choose a column that you can guarantee is fully populated. Other columns may have blanks and return a differnt row count.

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



    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  10. #10
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    323

    Re: Cell reference when inserting rows?

    "INDEX(whole column,2):INDEX(whole column,counta(whole column))." is VOLATILE, uhh, HELP PLEASE, TMS, zbor, AliGW......
    Attached Files Attached Files

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,181

    Re: Cell reference when inserting rows?

    I can't help further with Excel 2013 - sorry.

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Cell reference when inserting rows?

    INDEX isn't volatile, as far as I know.

  13. #13
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,640

    Re: Cell reference when inserting rows?

    If you do not want to use a volatile function and want to sum column B based on conditions in rows and strings in column G, with the number of rows from 2 to the maximum (e.g., 4000), you can use the following structure:

    Please Login or Register  to view this content.
    where "S-10;S-11" are the values to exclude in column G.

    So, for 1st 10 rows:

    Please Login or Register  to view this content.
    or for rows >11

    Please Login or Register  to view this content.
    Quang PT

  14. #14
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,966

    Re: Cell reference when inserting rows?

    Using :INDEX() as the second part of a range reference is semi-volatile only (i.e. recalcs at workbook open).
    Everyone who confuses correlation and causation ends up dead.

  15. #15
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,640

    Re: Cell reference when inserting rows?

    The INDEX function itself is not volatile.
    Using INDEX in a formula to create a sub-range does not make it volatile,
    but
    it may affect calculation performance if used in complex formulas or with large ranges

  16. #16
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    323

    Re: Cell reference when inserting rows?

    This is volatile INDEX(whole column,2):INDEX(whole column,counta), at least for me(Excel 2013,32bit).

    Can I use some sort of "helper sheet" with rows =Sheet2!A2....nah, after row insertion they would become A12.

    bebo021999's That part "(ROW($B$2:$B$4000)>1)*" is completely useless for my version of Excel, it simply do not work, only INDEX work.

  17. #17
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,966

    Re: Cell reference when inserting rows?

    Quote Originally Posted by B.W.B. View Post
    This is volatile INDEX(whole column,2):INDEX(whole column,counta), at least for me(Excel 2013,32bit).
    How are you determining that? It is only semi-volatile in any version I have used.

  18. #18
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,671

    Re: Cell reference when inserting rows?

    "(ROW($B$2:$B$4000)>1)*" is completely useless for my version of Excel, it simply do not work


    see attached ...
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  19. #19
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    323

    Re: Cell reference when inserting rows?

    Quote Originally Posted by romperstomper View Post
    How are you determining that? It is only semi-volatile in any version I have used.
    Semi or not, it's volatile, my older colleague just hate "Do you want save changes.." prompt.

  20. #20
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    323

    Re: Cell reference when inserting rows?

    Quote Originally Posted by JohnTopley View Post


    see attached ...
    It is working. Currently at home(Excel2016 x64). But my Sheet1 "There(sheet2) will be insert 10 rows from 2-11(new wday new report), also deleting everything below 3511 row.", hence, cell range $B$2:$B$4000 would become B12:B4000

  21. #21
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,966

    Re: Cell reference when inserting rows?

    Quote Originally Posted by B.W.B. View Post
    Semi or not, it's volatile, my older colleague just hate "Do you want save changes.." prompt.
    Then you appear to be out of luck as you have ruled out every alternative, and your entire approach, from what detail you have given, appears to be inefficient to me.

  22. #22
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    323

    Re: Cell reference when inserting rows?

    I also tried split formula(cell S7) into two part, that also wasn't working. This also gives #VALUE!
    Please Login or Register  to view this content.

+ 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. Inserting rows such that reference rows is after an automatic pagebreak
    By Tester80 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-09-2013, 04:16 PM
  2. Update reference cell after inserting new rows
    By kennethkoky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-06-2012, 04:47 PM
  3. Keeping cell reference the same after inserting rows
    By muadebe in forum Excel General
    Replies: 6
    Last Post: 08-27-2012, 12:43 PM
  4. using reference with inserting rows
    By excelmanager in forum Excel General
    Replies: 6
    Last Post: 10-28-2011, 05:00 AM
  5. Inserting rows in an external reference
    By theheavi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-15-2008, 12:55 AM
  6. Inserting Rows via function and reference
    By bigdaddymrp in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-21-2008, 08:43 AM
  7. Reference Problem w/ inserting rows
    By Paul987 in forum Excel General
    Replies: 5
    Last Post: 05-25-2006, 05:35 AM
  8. [SOLVED] Conditional Formatting Reference / Inserting Rows
    By Werner Rohrmoser in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-09-2005, 10:05 AM

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