+ Reply to Thread
Results 1 to 3 of 3

SumIf and Looping to find values of different conditions

  1. #1
    Registered User
    Join Date
    05-19-2013
    Location
    GBG Sweden
    MS-Off Ver
    Excel 2010
    Posts
    2

    SumIf and Looping to find values of different conditions

    I want to sum values in a column from more than one row,
    depending on certain accountnumbers (sorted) in another
    column. The problem is that the accountnumbers vary
    from time to time. Guess the code must consist av some
    kind of looping, finding the first accountno, some those
    rows, then go down to find the next different accountno,
    summing the values in the rows corresponding to that
    specific accountno etc. Until there is no more accountno
    to find. Finally summing the total sum for all the values.
    Please see my attached example in Excel.
    Rows and columns marked with yellow color, the values
    go from =SUM(D10:D17) and the result shows in I17.
    Then it goes on to the cells marked with red color.
    The final sum shows in I4. =SUM(I17:I21)
    Anyone who knows how to combine SUMIF with Looping?
    Thanks in advance
    Bjorn
    Attached Files Attached Files

  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,723

    Re: SumIf and Looping to find values of different conditions

    Put this formula in I10:

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


    then copy down. You may need to change the commas in the formula to semicolons.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    05-19-2013
    Location
    GBG Sweden
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: SumIf and Looping to find values of different conditions

    Thanks Pete

    This is what I was looking for. Works perfectly.
    Have a nice weekend, and a nice Midsummer.
    Why complicate things, using macros, looping etc.
    when a formula like yours works exellently...

    Best regards, Björn
    Last edited by btillroo; 06-20-2013 at 06:40 AM.

+ 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