+ Reply to Thread
Results 1 to 4 of 4

How do I prevent Excel from adjusting formulas when inserting new rows of raw data?

  1. #1
    Registered User
    Join Date
    11-14-2007
    Posts
    39

    How do I prevent Excel from adjusting formulas when inserting new rows of raw data?

    In Sheet 1, I've got all my raw data. Sheet 2 has the formulas that analyze this data. On a daily basis I need to insert new rows of raw data at the top of Sheet 1. However, Sheet 2 doesn't change since the formulas adjust themselves. If Row 2 in Sheet 2 initially was analyzing Row 2 in Sheet 1, inserting a row just above Row 2 in Sheet 1 causes Row 2 in Sheet 2 to adjust and therefore analyze Row 3 instead.

    Of course this is how Excel is supposed to work. But how do I stop it from doing this? I want Row 2 in Sheet 2 to ALWAYS analyze Row 2 in Sheet 1, regardless of how many rows I insert above Row 2 in Sheet 1.

    I also need Sheet 2 to expand its analysis to more rows as new rows of data are inserted at the top of Sheet 1. As an initial set up, I have 5 rows of raw data in Sheet 1. In Sheet 2, I have 5 rows analyzing their corresponding rows in Sheet 1. If I insert a row of data above Row 2 in Sheet 1, how do I make Sheet 2 automatically accommodate the extra row that was created by analyzing 6 rows (Rows 2-7) instead of the original 5? Here's a summary of all that I've said I want in a more visual form:

    Before Row Insertion:

    Sheet 1
    RedBox
    RedBird
    BlueSock
    YellowBird
    BlueBox

    Sheet 2 (before row insertion; periods divide columns)
    Red.......Box
    Red.......Bird
    Blue......Sock
    Yellow...Bird
    Blue......Box

    After Row Insertion:

    Sheet 1
    YellowSock
    RedBox
    RedBird
    BlueSock
    YellowBird
    BlueBox

    Sheet 2
    Yellow...Sock
    Red.......Box
    Red.......Bird
    Blue......Sock
    Yellow...Bird
    Blue......Box

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try adding this after each reference to the other sheet:

    Please Login or Register  to view this content.
    eg.

    If your original formula is something like: =Sheet1!A1+100, then the new formula would be =Sheet1!A1-ROW()+1+100
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    11-14-2007
    Posts
    39
    I can't make that work for me... nor am I sure exactly what it is supposed to do. Here's my formula. It's basically just a way of copying only those rows from my raw data that have the correct text in one of the columns.

    =IF(Sheet1!$A5="RedBox", Sheet1!A5, "")

    And then I drag this across for about 15 cells so that I can record all data that goes along with "RedBox."

    Where should I be inserting the formula you provided?

    Thanks!

  4. #4
    Registered User
    Join Date
    11-14-2007
    Posts
    39
    I've solved one of the two problems I posed in my initial post. In order to prevent Excel from adjusting my formulas when inserting a new row in my raw data, I needed to use the INDIRECT function, so that I could define the cells I wished by an ADDRESS, rather than by A1, B3, etc. Here's my formula:

    =IF(INDIRECT(ADDRESS(1+ROW(A1),1,,,"Sheet1"))="RedBox", INDIRECT(ADDRESS(1+ROW(A1),COLUMN(A1),,,"Sheet1")), "")

    But since I wanted to be able to drag the formula across and have it adjust correctly, I had to define some of the parts of the ADDRESS with the +ROW() expression.

    I still need to know how to automatically include a new row of data, but I'll create a new post for that.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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