+ Reply to Thread
Results 1 to 5 of 5

Maintain cell reference when inserting a row.

  1. #1
    Registered User
    Join Date
    10-02-2019
    Location
    Pooler, Ga
    MS-Off Ver
    Pro 2016
    Posts
    19

    Maintain cell reference when inserting a row.

    I use the following formula---sumif(f2:f10,"=10/1/2019",G2:G10). Proceeded by the equal sign of course. The purpose is to look for any values in Column F that equal 10/1/2019, and then sum all of the values in the corresponding rows in column G. Here is my problem though. Often I need to insert one to several rows at row 2. When I do so, the f2 and g2 will increment by the number of inserted rows. So, if I insert two rows, F2 becomes F4.

    Is there a way to keep "F2" constant? If you have a solution, please show me the precise syntax for my formula in your reply. I understand better that way.

    Thanks

  2. #2
    Registered User
    Join Date
    10-02-2019
    Location
    Pooler, Ga
    MS-Off Ver
    Pro 2016
    Posts
    19

    Re: Maintain cell reference when inserting a row.

    BTW, I just discovered a potential work around. Of course, I thought of it after posting. If I insert the rows starting at row 3 instead of two (Row 1 is occupied by headers), then the F2 and G2 remains constant. However, the F10 and G10 will increment. So, this is not a complete work around.

  3. #3
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Maintain cell reference when inserting a row.

    Hello Tedejr and Welcome to Excel Forum.
    I am not sure that I understand the problem. It would seem that if you add a row after row 2, then you would want the formula to increase the range i.e. =SUMIF(F2:F11,"10/1/2019",G2:G11).
    However if you want to restrict the range to rows 2:10 then try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  4. #4
    Registered User
    Join Date
    10-02-2019
    Location
    Pooler, Ga
    MS-Off Ver
    Pro 2016
    Posts
    19

    Re: Maintain cell reference when inserting a row.

    Yes, the goal is to keek the selection fixed.. So, I may try the "indirect" solution in a few days. At the beginning of each month the workbook updates. So I don't want to possibly muck anything up so close to that point.

    What was happening though was that if I inserted a row at row two, then the formula would change from F2:F10 to F3:F11. Loosing the data from row two. And that was unacceptable. My workaround up to this point was to add a row at row 3. That would change the range from F2:F10 to F2:F11. Which for me is okay. As long at maintains a reference to row two.

    Thanks for the response. I will let you know what will happen after that.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Maintain cell reference when inserting a row.

    Based on the description I don't believe that the INDIRECT formula is going to do what you want as it will not sum data except that in the range G2:G10 even if the actual data extends further.
    It would seem that the formula could be written: =SUMIF(F1:F10,"10/1/2019",G1:G10)
    Presumably F1 will be a header such as Date so G1 would not be included in the summation anyway.
    Now if you insert new rows at row 2 you should still get the expected result.
    Let us know if you have any questions.

+ 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. Macro to allow for inserting rows & maintain conditional format ranges
    By spenlinhauer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2015, 01:38 AM
  2. can I maintain aspect ratio when inserting pictures
    By tryer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-07-2010, 09:41 AM
  3. Maintain range when inserting columns
    By dperry in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-02-2009, 12:27 AM
  4. Maintain Formulas / Cell reference help
    By wjsok85 in forum Excel General
    Replies: 4
    Last Post: 06-18-2009, 08:11 AM
  5. 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
  6. Maintain Relative Reference After Inserting a Column
    By Mark T. in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-04-2006, 01:00 AM
  7. [SOLVED] Copy worksheet & maintain cell reference across worksheets
    By dingy101 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-02-2006, 06:55 AM

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