+ Reply to Thread
Results 1 to 6 of 6

Locked formula changes reference when rows added to reference sheet in same workbook

  1. #1
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    Locked formula changes reference when rows added to reference sheet in same workbook

    I have a formula which works as I need it to work -- at least the first time I use it. That formula is listed as "Original Formula", below. My problem with the formula is that it refers to a separate sheet ("Locked Loans"), and the Locked Loans sheet has a macro which inserts two new rows between categories of loans, based on the data that is uploaded. So every time the macro runs, my formula below adds two rows to the sections I highlighted in red/bold. For example, I ran the macro once, and it changed my Original Formula (below) to the formula called "Adjusted Formula". I would like for the Locked Loans sheet reference to always evaluate rows #13-1,000; however, even with those cells locked (with the "$" sign) they adjust when rows are added to the Locked Loans sheet. Any creative thoughts? Thanks very much, in advance.

    Original Formula
    Please Login or Register  to view this content.
    Adjusted Formula
    Please Login or Register  to view this content.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Locked formula changes reference when rows added to reference sheet in same workbook

    You can use INDIRECT to ensure that the range does not vary, as the references within the INDIRECT function are actually text values so do not change when rows are inserted. Your original formula would become:

    =IF($C62=0,"",IF($C62="","",((SUMPRODUCT((1-ISNUMBER(MATCH(INDIRECT("'Locked Loans'!$AA$13:$AA$1000"),$AC$60:$AJ$60,0)))*(INDIRECT("'Locked Loans'!$E$13:$E$1000")=$A62)*INDIRECT("'Locked Loans'!$C$13:$C$1000")))/$C62)))

    Hope this helps.

    Pete

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Locked formula changes reference when rows added to reference sheet in same workbook

    i think this should do it but i cant see what it does to test it
    =IF($C64=0,"",IF($C64="","",((SUMPRODUCT((1-ISNUMBER(MATCH(INDEX('locked loans'!AA:AA,13):INDEX('locked loans'!AA:AA,1000),$AC$62:$AJ$62,0)))*(INDEX('locked loans'!E:E,13):INDEX('locked loans'!E:E,1000)=$A64)*INDEX('locked loans'!C:C,13):INDEX('locked loans'!C:C,1000)))/$C64)))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    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
    44,431

    Re: Locked formula changes reference when rows added to reference sheet in same workbook

    Try:

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



    Regards, TMS
    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


  5. #5
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: Locked formula changes reference when rows added to reference sheet in same workbook

    Pete_UK, martindwilson and TMShucks -- those options work! Thank you very much!!! Have a nice day.

  6. #6
    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
    44,431

    Re: Locked formula changes reference when rows added to reference sheet in same workbook

    You're welcome

+ 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. Dragging formula, change sheet reference, but not cell reference
    By Kalilaya0419 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-13-2013, 04:50 PM
  2. [SOLVED] copy active sheet, create new workbook, name new workbook based on cell reference
    By jm0392 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-20-2012, 07:12 PM
  3. Replies: 3
    Last Post: 06-11-2010, 06:40 AM
  4. Unchanging sheet reference when rows are added
    By thequickness in forum Excel General
    Replies: 5
    Last Post: 10-28-2009, 05:24 AM
  5. Replies: 2
    Last Post: 05-01-2009, 07:06 PM

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