+ Reply to Thread
Results 1 to 12 of 12

Summing largest value per individual

  1. #1
    Registered User
    Join Date
    11-22-2012
    Location
    United States
    MS-Off Ver
    Office 2013
    Posts
    25

    Summing largest value per individual

    Hi,

    I'm trying to get the sum of the largest number from each individual 4-digit account and am not sure how to make it so that the formula only takes the largest number per account. Here is the data:

    Account number Amount Given
    2012 - 200
    2012 - 400
    6475 - 200
    6475 - 400
    2211 - 200
    4836 - 200
    2687 - 200
    2228 - 200
    2228 - 400
    2228 - 600
    9557 - 200
    0944 - 200
    0732 - 200
    0732 - 400
    0320 - 200
    0320 - 400
    3957 - 200
    3957 - 400
    3957 - 600
    3957 - 800
    3957 - 1000
    3957 - 1200
    4167 - 200
    7723 - 200
    1643 - 200
    1643 - 400

    Thanks for the help!

  2. #2
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Re: Summing largest value per individual

    what are you using this for?
    Can it go into a chart?

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Summing largest value per individual

    My guess is there is a non volatile solution, but my effort...

    =MAX(OFFSET($A$1,MATCH($F$1,$A$2:$A$27,0),1,COUNTIF($A$2:$A$27,$F$1)))

    Where F1 holds the Account number
    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    11-22-2012
    Location
    United States
    MS-Off Ver
    Office 2013
    Posts
    25

    Re: Summing largest value per individual

    Thanks Jeff,

    I'm trying to understand your formula. Would the account number = column F and the amount given = column A?

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Summing largest value per individual

    use a pivot table see attached
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Summing largest value per individual

    I like Martin's suggestion with the pivot table as it gives you everything in one feel swoop.

    Here is the workbook with the formula.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-22-2012
    Location
    United States
    MS-Off Ver
    Office 2013
    Posts
    25

    Re: Summing largest value per individual

    Thank you both,

    It seems that the table takes the largest value from each account, but then selects the largest of those numbers in place of summing them. How can I change that?

    Ideally, it would work so that whenever new data is added, either new accounts or larger amounts, the output would change automatically. Would the pivot table accomplish this without further tinkering?

    All the best

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Summing largest value per individual

    right click table in options uncheck grand total then put =sum(f:f) or sum (f3:f10000) somewhere this will total the maxes
    you can make the range bigger and hide blanks
    when new data is added right click table and refresh
    this one has the range set to a1:b400 and the grand total hidden
    add something to the bottom then refresh
    Attached Files Attached Files
    Last edited by martindwilson; 11-22-2012 at 12:13 PM.

  9. #9
    Registered User
    Join Date
    11-22-2012
    Location
    United States
    MS-Off Ver
    Office 2013
    Posts
    25

    Re: Summing largest value per individual

    I had tried that but then it sums all of the values instead summing the single largest number from each account

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Summing largest value per individual

    This can be done with a few setup steps.

    First, create a named range
    MyPivot =OFFSET(Sheet1!$A$1,,,COUNTA(Sheet1!$A:$A),2)

    Click on the pivot table >> on the ribbon >> Options >> Data >> Change Data Source >> Table/Range: MyPivot

    Right click on the max column in the pivot table >> value field settings >> Sum

    Now every time data is added, right click on the pivot table and select refresh.

    This could also be done (the refresh) with a small macro

  11. #11
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Summing largest value per individual

    not within the pivot table-if you change to sum all the other rows change to sum too. you need a sum formula above the pivot and turn off the grand total row. or use a helper column and formulas assuming your data is sorted by account
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Summing largest value per individual

    yea i updated my post to hide grand total then use sum(f3:f10000) instead

+ 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