+ Reply to Thread
Results 1 to 18 of 18

My array formula TOP items

  1. #1
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    My array formula TOP items

    Ok guys last one.

    Here is my array formula which gives me the TOP item found in a list. It only gives me 1, I want top 5 items.
    Please Login or Register  to view this content.
    Is there a formula that will give me the TOP 5 items?

    Thank you,
    Brian

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: My array formula TOP items

    What kind of data is it? Text? Numbers?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: My array formula TOP items

    It is for "text" Tony.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: My array formula TOP items

    I have the data in column A sorted just to make it easier to see what results should be expected.

    Data Range
    A
    B
    C
    1
    Climp
    ------
    Climp
    2
    Climp
    Rosk
    3
    Climp
    Plump
    4
    Rosk
    Jumor
    5
    Rosk
    Puss
    6
    Rosk
    7
    Plump
    8
    Plump
    9
    Jumor
    10
    Jumor
    11
    Puss
    12
    Puss
    13
    Blim
    14
    Blam
    15
    Toots


    This array formula** entered in C1:

    =INDEX(A1:A15,MODE(MATCH(A1:A15,A1:A15,0)))

    This array formula** entered in C2 and copied down to C5:

    =INDEX(A$1:A$15,MODE(IF(COUNTIF(C$1:C1,A$1:A$15)=0,MATCH(A$1:A$15,A$1:A$15,0))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  5. #5
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: My array formula TOP items

    Thank you Tony very much.

  6. #6
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: My array formula TOP items

    This was a BIG help!

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: My array formula TOP items

    You're welcome. Thanks for the feedback!

  8. #8
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: My array formula TOP items

    Somethings not right...I keep getting #N/A

  9. #9
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: My array formula TOP items

    I don't think MODE is working for this, I am tracing the step and it keeps pointing to MODE

  10. #10
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: My array formula TOP items

    Maybe it should be Frequency,instead of MODE for the first part of the formula

  11. #11
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: My array formula TOP items

    The problem is this...the formulas have to account for empty cells that contain no data yet,as these cells will be populated with data as the weeks go by. That's why I am getting the #N/A.
    The column range is much greater the 15 my friend. The actual range for the column is B5:B304. Which as the weeks go by data is inputted in to the cells.

    Can that be fixed?

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: My array formula TOP items

    Quote Originally Posted by Tony Valko View Post
    This array formula** entered in C1:

    =INDEX(A1:A15,MODE(MATCH(A1:A15,A1:A15,0)))
    Actually that one doesn't require CSE.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  13. #13
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: My array formula TOP items

    To amend Tony's set-up to account for blanks:

    In C1, array formula**:

    =INDEX(A1:A15,MODE(IF(A1:A15<>"",MATCH(A1:A15,A1:A15,0))))

    In C2, array formula**:

    =INDEX(A$1:A$15,MODE(IF(A$1:A$15<>"",IF(COUNTIF(C$1:C1,A$1:A$15)=0,MATCH(A$1:A$15,A$1:A$15,0)))))

    and copy down to C5.

    I notice you don't say what should be the result if the number of entries with a frequency of 2 or more is less than 5?

    Regards

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: My array formula TOP items

    Quote Originally Posted by XOR LX View Post
    Actually that one doesn't require CSE.
    Yes, I see that!

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: My array formula TOP items

    Quote Originally Posted by b_rianv View Post
    Can that be fixed?
    Yes, I think using a dynamic range is in order.

    Create this named range...
    Name: Range (or whatever you want to call it)
    Refers to: =$B$5:INDEX($B:$B,MATCH("zzzzz",$B:$B))

    Then, the formulas would be:

    Entered in C1:

    =INDEX(Range,MODE(MATCH(Range,Range,0)))

    This array formula** entered in C2 and copied down to C5:

    =INDEX(Range,MODE(IF(COUNTIF(C$1:C1,Range)=0,MATCH(Range,Range,0))))

  16. #16
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: My array formula TOP items

    Ah, yes. Perhaps I misunderstood. If the blanks are only at the very end of the data then Tony's amended set-up will be much more efficient than that I gave.

    Regards

  17. #17
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: My array formula TOP items

    Yes it is fixed now by both formulas, Thank you both for your time and effort to help me.

    Have a great weekend guys!!

  18. #18
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: My array formula TOP items

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 05-26-2016, 09:30 AM
  2. Array formula to return list of unique items from selected columns only
    By jlawton1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2016, 04:53 AM
  3. [SOLVED] Looping through dictionary items where items are an array
    By strud in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2014, 06:56 AM
  4. [SOLVED] [SOLVED] Array formula to sum items that meet multiple conditions
    By TPDave in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-07-2014, 08:16 AM
  5. Replies: 10
    Last Post: 01-21-2012, 06:03 AM
  6. Replies: 7
    Last Post: 04-16-2009, 01:03 PM

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