+ Reply to Thread
Results 1 to 4 of 4

Variable column sum

  1. #1
    Registered User
    Join Date
    09-22-2014
    Location
    Silicon Valley, California
    MS-Off Ver
    2007
    Posts
    40

    Variable column sum

    I frequently need to sum a column of numbers where I will also need to add rows. This works fine unless I add a row at the top or bottom of the range. Then the sum range gets messed up.

    B
    3 Cost
    4 $12.95
    5 $4.99
    6 $23.75
    7 $41.69

    The formula in B7 is =SUM(B4:B6).

    If I insert a row between 3 & 4 or between 6 & 7, the sum range is wrong.

    My solution has been to use the Offset function inside the Sum function.

    Please Login or Register  to view this content.
    Is there a simpler way?

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Variable column sum

    Half your problem will disappear if you use:=

    Please Login or Register  to view this content.
    if inserting at the last row
    then copy, insert paste the last row
    then over type

    ie select row by clicking on the row number
    right click and copy
    right click insert copied cells

  3. #3
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Variable column sum

    You could name your ranges - ie name cell B4, B5 and B6 and then sum the names and then sum =Sum(name1,name2,name3)
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Variable column sum

    If the column of values in column B has a title, you could turn that range of cells into a Table by selecting the cells including the title and Insert Table. On the design tab select Total Row, Header Row and uncheck Banded Rows if you don't want the usual bands present in a table. After doing this, you can insert rows under the header and above the total as much as you like and the total will automatically update.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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] Sum column based on variable start and variable end months
    By Steve N. in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-06-2013, 08:01 PM
  2. Replies: 6
    Last Post: 04-14-2012, 04:07 AM
  3. Replies: 4
    Last Post: 01-14-2011, 09:30 PM
  4. Assigning a variable and pasting variable to last unused column.
    By Ageia in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-20-2008, 05:06 PM
  5. Sum cells based on a row variable and seperate column variable
    By CheeseHeadTransplant in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-23-2005, 02:05 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