+ Reply to Thread
Results 1 to 4 of 4

Aggregate data and then display the 5 largest unique names with total values

  1. #1
    Registered User
    Join Date
    07-03-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    2

    Aggregate data and then display the 5 largest unique names with total values

    Hi,

    I have about 200 rows of data that essentially boils down to something like this example:
    A .5
    B .7
    C .1
    D .1
    A 1.0
    B .4
    C .25
    E .6

    The results I'm looking for is to be able to list the top 5 by total amount. So if it worked perfectly I would get:
    A 1.5
    B 1.1
    E 0.6
    C 0.35
    D 0.10

    It's easy to get the sumation of the values, but what I can't get is to somehow only display the total for one unique value. My issue is that I was using a sumif on each line so every A would have the 1.5 value. Then when I use the large function it would list this:
    A 1.5
    A 1.5
    B 1.1
    B 1.1
    E 0.6
    C 0.35
    C0.35

    I would love to know how to develop a function(s) that eliminates the double (like above) and just gives me the top 5 (or 10 or whatever) unique names with total amounts from the range.

    I'm so hopeful someone can help me as I've exhausted everything I know and have read on other posts that seem related.

    Thanks

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Aggregate data and then display the 5 largest unique names with total values

    Hi

    If the above raw data is in the range A1:B8 then
    C1: =SUMIF($A$1:$A$8,A1,$B$1:$B$8) Copy down to C8
    D1: =IF(COUNTIF($C$1:C1,C1)=1,C1,"") Copy down to D8
    E1: =INDEX(A:A,MATCH(F1,C:C,0)) copy down to E5
    F1: =LARGE($D$1:$D$8,ROW()) copy down to F5


    HTH

    rylo

  3. #3
    Registered User
    Join Date
    07-03-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Aggregate data and then display the 5 largest unique names with total values

    This is great. Absolutely what I needed. The countif with the moving range was the big trick for me. Thanks for showing me that. One question: what happens if by chance two values sum (say A & B) to exactly the same amount (i.e. 1.5)?

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Aggregate data and then display the 5 largest unique names with total values

    Hi

    It will take the first one that it comes across.

    rylo

+ 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