+ Reply to Thread
Results 1 to 14 of 14

How to count top 10 values?

  1. #1
    Registered User
    Join Date
    01-30-2006
    Posts
    24

    How to count top 10 values?

    Hi,

    I couldn't find the right formula for this... I'd like to sum top 10 values from a range of values in cells. Currently only way I can think of is to sort all the values first and then count the top 10 cells. But is there a way to find the top values with a automatic formula, which would fit to one cell?

    Example:

    A
    4
    6
    8
    3
    13
    4
    16
    11
    9
    2
    8
    8
    10
    5

    Sum from top 10 values would be 96... But how to reach this with a formula?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to count top 10 values?

    =sumif(a1:a14, ">=" & large(a1:a14, 10))

    EDIT: That's in error if there are multiple values at Large(..., 10)
    Last edited by shg; 05-26-2009 at 04:16 PM.
    Entia non sunt multiplicanda sine necessitate

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

    Re: How to count top 10 values?

    I get 94 with:

    =SUMPRODUCT(--(A1:A14>=LARGE(A1:A14,10)),A1:A14)
    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.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to count top 10 values?

    On the off-chance you happen to have multiple instances of the 10th largest value you may need to use something along the lines of the below if only 1 of said value is to be included:

    =SUMPRODUCT(LARGE(A1:A14,ROW(INDIRECT("1:10"))))

    Note: the use of INDIRECT makes the above Volatile.

  5. #5
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: How to count top 10 values?



    =SUM(LARGE(A:A,ROW(INDIRECT("1:"&ROWS(1:10)))))

    Confirm with ctrl+shift+enter

    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to count top 10 values?

    =sum(large(a1:a14, {1,2,3,4,5,6,7,8,9,10}))

    Confirm with regular old Enter.

  7. #7
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: How to count top 10 values?

    Hm,
    in point of fact alomost all formulas are the same...

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to count top 10 values?

    Not really -- yours is a CSE Array, mine is not a CSE Array but is processed like an Array (and is Volatile) whereas shg's is the more efficient being neither an Array nor Volatile.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to count top 10 values?

    Also, CWE, your formula changes if you insert rows anywhere above row 10, and NBVC's formula has the same problem as the first one I posted.

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

    Re: How to count top 10 values?

    And CWE's won't work in Excel 2003 or earlier do the whole column ref of A:A in a CSE formula.

  11. #11
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: How to count top 10 values?


    Sorry if I said smth that you became angry with.

    I just wanted to say that in most cases there were used LARGE, SUM, and ROW functions. Thst's why I said that they are the same...

    Only this.
    .

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to count top 10 values?

    No one is angry at all ...

  13. #13
    Registered User
    Join Date
    01-30-2006
    Posts
    24

    Re: How to count top 10 values?

    Thanks for all the replies! shg's suggestion seems to be very simple and works great and yeah, the result should be 94 instead of 96 like I said earlier...

  14. #14
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to count top 10 values?

    Great. Would you please mark the thread as Solved?

+ 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