+ Reply to Thread
Results 1 to 7 of 7

Sum everything upto the current row number

Hybrid View

  1. #1
    Registered User
    Join Date
    04-05-2009
    Location
    ZG
    MS-Off Ver
    2010
    Posts
    12

    Sum everything upto the current row number

    So, I need to keep adding together all the numbers from cell row 0 upto and including the row number of the cell with the result. The column with the results is to the right of the column with numbers to add. So, if the numbers are positive, to the right of each should be an ever increasing number as a result. In the column with the numbers to add is a function which as a result gives either numbers or blank cells. It sounds simple but it is frustrating me. Why can't I use the function SUMIF with a ROW function inside the condition field? It always gives me 0 as the result. I use excel 2003.

    I probably do't understand the SUMIF function but why isn't =SUMIF(A:A;"1>0") equivalent to =SUM(A:A). This too gives the result of 0. Why don't I get an error instead.
    Last edited by lampas89; 04-06-2009 at 12:41 PM.

  2. #2
    Registered User
    Join Date
    04-05-2009
    Location
    ZG
    MS-Off Ver
    2010
    Posts
    12

    Re: Sum everything upto the current row number

    Ok, I need to clarify this further: there will be no separate column with the results, I need a formula which calculates the sum but it will be put into another formula, so it has to be done without a separate column.

  3. #3
    Forum Contributor
    Join Date
    03-31-2009
    Location
    Childers QLD, Australia
    MS-Off Ver
    Excel 2003, 2007 & 2013
    Posts
    128

    Re: Sum everything upto the current row number

    Hi,

    Try SUMIF(A:A,">1",A:A), I think it should help.

    Cheers

    Tony

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum everything upto the current row number

    I think you simply need something like:

    =Sum($A$1:A$1)

    copied down

    This will "freeze" the start of the range to A1 and as you copy down, the bottom of the range increases by 1... so you are doing a rolling sum.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    04-05-2009
    Location
    ZG
    MS-Off Ver
    2010
    Posts
    12

    Re: Sum everything upto the current row number

    =Sum($A$1:A$1) didn't work so I tried =Sum($A$1:A1) and that was it.

    Freezing the first cell when copying was exactly what I wanted, just didn't know how to do it.

    Thanks.

    Tony, when I posted the formula =SUMIF(A:A;"1>0"), instead of "1>0" I could have put any expression which is always true, because I thought it would be equivalent to =SUM(A:A), but obviously SUMIF doesn't work the way I thought it does. Anyway my real problem is solved the second question isn't really important.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum everything upto the current row number

    Quote Originally Posted by lampas89 View Post
    =Sum($A$1:A$1) didn't work so I tried =Sum($A$1:A1) and that was it.

    Freezing the first cell when copying was exactly what I wanted, just didn't know how to do it.

    Thanks.
    Yes, my mistake, I froze row instead of column... I meant to do this:

    =Sum($A$1:$A1) and copy down.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum everything upto the current row number

    If you've got a solution, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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