+ Reply to Thread
Results 1 to 6 of 6

Order Data Set by name

  1. #1
    Registered User
    Join Date
    11-30-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Order Data Set by name

    Can someone please help me with this query:


    I have the following data set, the first row is the week number, the first column is the product. So therefore we have sales by week.

    excel.jpg

    I want a formulae where I can edit the week number in cell B11 and have returned the top 5 selling fruits of that week, not just the top 5 values from the column.

    So my results where B11=1, should look like:


    Guava
    Melons
    Strawberry
    Kiwi
    Oranges

    and NOT:

    66
    12
    11
    9
    7

    I guess I should also give some consideration to if the sales for 2 products were the same, in that case, it should order those results alphabetically.

    Thanks Guys!

  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: Order Data Set by name

    See if this helps:

    How to create a top N list
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    11-30-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Order Data Set by name

    Thanks, but how do I get it to change the column it is checking the results against when changing the week number?

    I've attached an excel file with the above example

    Book1.xlsx

  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: Order Data Set by name

    Try this...

    A12 header = Count

    Enter this formula in B12. This will return the count of records that fall within the top 5 and accounts for ties.

    =COUNTIF(INDEX(B2:D9,0,B11),">="&LARGE(INDEX(B2:D9,0,B11),5))

    A14 header = Top 5

    Enter this array formula** in B14:

    =IF(ROWS(B$14:B14)>B$12,"",INDEX(A$2:A$9,MATCH(LARGE(INDEX(B$2:D$9,0,B$11)-ROW(A$2:A$9)/100000,ROWS(B$14:B14)),INDEX(B$2:D$9,0,B$11)-ROW(A$2:A$9)/100000,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.

    Copy down to B21.

  5. #5
    Registered User
    Join Date
    11-30-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Order Data Set by name

    Thank You Tony!

    You are amazing

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

    Re: Order Data Set by name

    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: 34
    Last Post: 01-21-2014, 03:07 PM
  2. Replies: 1
    Last Post: 09-10-2013, 09:24 AM
  3. [SOLVED] Quantity in column D based on order amount of times the order no appears
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-19-2013, 06:48 PM
  4. Replies: 0
    Last Post: 03-19-2013, 12:23 AM
  5. [SOLVED] Generate "ascending order no" for columns of data that are not in order
    By abreichenbach in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-20-2013, 02:22 AM

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