+ Reply to Thread
Results 1 to 4 of 4

Picking top 5 values when there are duplicate values

  1. #1
    Registered User
    Join Date
    08-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Picking top 5 values when there are duplicate values

    Hi,

    I am working with a dataset of companies which contains for each company a name and a value for its previous week's revenue. I am trying to create a report which automatically selects the top five revenue companies each week. Unfortunately, because the data is only available up to 2dp, it fairly frequently occurs that two companies have exactly the same revenue and so my list of the top 5 contains duplicates and some companies are missed. For example if Company A had a revenue of 2.34, Company B had a revenue of 1.85, Company C 1.46, Company D 2.98 and Company E 1.85, the list goes Company D, Company A, Company B, Company B, Compancy C.

    Currently I am using the formula INDEX($B$19:$C$28,MATCH(LARGE($C$19:$C$27,1),$C$19:$C$28,FALSE),1), where column B is the company name and column C is the previous week's revenue, to pull the largest company, and then changing the number in the large function for the other top 5.

    I would be very appreciative if someone could suggest a way to modify this formula to force Excel to rank companies with identical revenues one after the other.

    Thank you!

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Picking top 5 values when there are duplicate values

    Try this array formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ---------- Post added at 11:01 AM ---------- Previous post was at 11:00 AM ----------

    BTW, you don't need to edit LARGE in this, just copy it down for 5 cells and it auto-updates.

  3. #3
    Registered User
    Join Date
    08-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Picking top 5 values when there are duplicate values

    thanks very much! I will try that now.

    ---------- Post added at 10:08 AM ---------- Previous post was at 10:05 AM ----------

    At the moment it is returning a #VALUE error - could this be because of the A1 reference? At the moment I have an unrelated piece of information in cell A1.

    ---------- Post added at 10:15 AM ---------- Previous post was at 10:08 AM ----------

    Actually don't worry - it's just because I didn't hit ctrl shift enter!

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Picking top 5 values when there are duplicate values

    Quote Originally Posted by puzzledanalyst View Post
    At the moment it is returning a #VALUE error - could this be because of the A1 reference? At the moment I have an unrelated piece of information in cell A1.

    ---------- Post added at 10:15 AM ---------- Previous post was at 10:08 AM ----------

    Actually don't worry - it's just because I didn't hit ctrl shift enter!
    You beat me to it

    ---------- Post added at 11:18 AM ---------- Previous post was at 11:16 AM ----------

    Quote Originally Posted by puzzledanalyst View Post
    At the moment it is returning a #VALUE error - could this be because of the A1 reference? At the moment I have an unrelated piece of information in cell A1.
    Note it is just getting the ROW of A1, not actually looking at A1. This is how it auto-updates, as the second formula gets ROW(A2) and so on (LARGE1, LARGE 2,...).
    Last edited by Bob Phillips; 08-28-2012 at 06:30 AM.

  5. #5
    Registered User
    Join Date
    08-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Picking top 5 values when there are duplicate values

    ahhhh! thanks!

+ 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