+ Reply to Thread
Results 1 to 7 of 7

how to make a cell forumla stick when inserting a row above it

  1. #1
    Registered User
    Join Date
    10-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1

    how to make a cell forumla stick when inserting a row above it

    I have some forumlas at the bottom of a spreadsheet. The make summations of the columns of the spreadsheet. When I insert a new row at the top to create another entry it changes the forumla like so:

    summed value=SUM($B$2:B455)

    If I insert a new row at the top it changes to:

    summed value==SUM($B$3:B456)

    I want the 2nd reference to change (B455 to B456). But I want the first reference to always be B2, is there a good way to setup the formula for this?

    Thanks for any input.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: how to make a cell forumla stick when inserting a row above it

    If you make B2 a named range then you can insert rows and it will only change the second part of the range reference. eg if B2 is named 'test' Then
    Please Login or Register  to view this content.
    Should only change the B455 to B456 when a row is inserted above row 455.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    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
    48,548

    Re: how to make a cell forumla stick when inserting a row above it

    Maybe
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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


  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
    48,548

    Re: how to make a cell forumla stick when inserting a row above it

    If you make B2 a named range then you can insert rows and it will only change the second part of the range reference.
    No. The Named Range will move down as rows are inserted above it.

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: how to make a cell forumla stick when inserting a row above it

    Quote Originally Posted by TMS View Post
    No. The Named Range will move down as rows are inserted above it.
    True if you insert above B2 and I suppose that was what the OP was doing. I just overlooked that fact.

  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
    48,548

    Re: how to make a cell forumla stick when inserting a row above it

    Yes. The OP did say
    If I insert a new row at the top it changes to:

    summed value==SUM($B$3:B456)

  7. #7
    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. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,256

    Re: how to make a cell forumla stick when inserting a row above it

    The easiest way to deal with this is to convert the range to a table and then use the SUBTOTAL function at the foot of the table. e.g:

    =SUBTOTAL(9,[Column1])
    Attached Files Attached Files
    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.

+ 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. [SOLVED] How to Make Custom Formatting Stick
    By AliGW in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 11-02-2015, 07:57 AM
  2. Can't make Enable Editing stick
    By simonc2 in forum Excel General
    Replies: 2
    Last Post: 06-19-2014, 08:02 AM
  3. [SOLVED] Make a cell forumla equal a text string
    By HeebieGeebie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2013, 07:57 AM
  4. Replies: 1
    Last Post: 08-28-2012, 02:36 AM
  5. Ading data and make excel add a number and stick with it
    By Hemmiv in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-07-2008, 08:02 AM
  6. Make pivotchart formatting stick after pivottable refresh.
    By larry garka in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-16-2006, 02:55 PM
  7. [SOLVED] I wanna make my normal style stick, but it won't !
    By Xerk in forum Excel General
    Replies: 4
    Last Post: 03-17-2006, 01:50 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