+ Reply to Thread
Results 1 to 5 of 5

Problem with SUM function and absolute & relative references

  1. #1
    Registered User
    Join Date
    06-25-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    2

    Problem with SUM function and absolute & relative references

    Say I have a table with the following column:
    A
    1
    1
    1

    I'm trying to set up a sum column B that sums all previous corresponding values in A. Example:
    A B
    1 1
    1 2
    1 3

    To do this, i'm currently defining the B1 cell as =SUM($A$1:A1). This allows B2 to be defined as =SUM($A$1:A2), B3 as =SUM($A$1:A3), and so on.

    At first, this all works out for me. But then, when I try to append another row to the bottom of the table, the function screws up for PRECEDING B-cell, so that, if I enter a 4th row, B4 is =SUM($A$1:A4), but so is B3. Furthermore, this problem continues as I add rows; for example, if I add rows so that the table has a total of 8 rows, B3 thru B8 would all be defined as =SUM($A$1:A8).

    Anyone have any advice on why this is happening, and what I can do to solve this problem?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Problem with SUM function and absolute & relative references

    maybe this is too simplistic, or maybe im not understanding you correctly, but couldnt you just add the cell above to the cell at the side?

    so B2 would be B1+A2 copied down. then you wouldnt need to absolute anything. you said its a table, so im assuming its what excel defines as a TABLE, in which case it can do funky things with fromulas (from my experience)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Problem with SUM function and absolute & relative references

    Hi and welcome to the forum,

    How about trying another formula in B2 = A2+B1 and pull it down.
    (In B1 you will need a formula of = A1)

    When you insert a new row simply pull the formula in B2 all the way to the end.

    Does this work for you?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Problem with SUM function and absolute & relative references

    with those formulas maybe immediately drag down say up to 20-30 cells to copy the formula then you can add values in column a.

    and maybe also put some checking like
    =if(A1="","",SUM($A$1:A1)



    **the error i think is when you drag it, copies only one cell like you said
    B3 thru B8 would all be defined as =SUM($A$1:A8)
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  5. #5
    Registered User
    Join Date
    06-25-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Problem with SUM function and absolute & relative references

    FDibbins and MarvinP, that works! Thanks a ton!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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