+ Reply to Thread
Results 1 to 13 of 13

Duplicate Data ranking issue

  1. #1
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    Duplicate Data ranking issue

    Ok so if I have a list of say 500 companies and I'm calculating their year over year return and I then want to rank them from highest to lowest. I'm using the Large( formula to rank them in order from 1-500. The problem I run into is there may be companies with the exact same yoy return number (rare but it happens that the numbers are exactly the same). Is there a formula I can use that will somehow fix this so I don't have two of the same companies in my ranked list table? Any help would be much appreciated.

    Cheers

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Duplicate Data ranking issue

    One way is to add a trivially small number to the YoY, based on the row number it's sitting in. here's a sheet showing you how. If you'd prefer me to work with your sheet...

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).


    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Duplicate Data ranking issue

    You should be able to manage this, but it's difficult to say exactly how without seeing a sample of your data. I find that the easiest way is usually to build a tiny decimal into your values that is then hidden by formatting, so that you have a build in tie-breaker. In my attachment, I've but the companies in column A and the returns in column B, then in F2 I use the following formula, array-entered with Ctrl + Shift + Enter instead of Enter:

    =LARGE($B$2:$B$8+0.0001*ROW($B$2:$B$8),ROW(1:1))

    Then in G2 (non-array):

    =INDEX($A$2:$A$8,10000*(F2-INT(F2))-1)

    Then fill down as far as you need to. Format the cells in column F to show only the digits you want showing, and you should have a ranking in which ties are no longer problematic. Take a look at the attachment; hopefully it proves helpful:
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    Re: Duplicate Data ranking issue

    I've attached an example. On sheet #1 is the formula I was using to rank them in order and on sheet #2 are the returns and companies in no real order.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    Re: Duplicate Data ranking issue

    I posted an example because I have the data on two different sheets and tried to use the formula you posted in your example but can't seem to get it to work. Thanks for your help!

  6. #6
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    Re: Duplicate Data ranking issue

    I think I may have found a solution I just want to check with you to see if you agree that this would work. So in the formula I have to calculate the return this is what I've done and it seems to work ok. (a5/c5-1)+Row()/1000000000

  7. #7
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Duplicate Data ranking issue

    In the case of a tie, what's your desired result? In your sample post, Cells C30 and C31 both show 2.0% - do you want 2.0% to only appear once, then continue with the list so that C31 becomes 1.4%? Should the 2.0% appear in both cells but not actually be perfectly equivalent? What's the overall goal?

  8. #8
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    Re: Duplicate Data ranking issue

    I would need both numbers and if they are exactly the same like the 2% and 2% I don't really care which one shows up on top of the other. I use those return numbers once ranked to then look up off of to find and pull in the ticker symbol of the company associated with that return which is where I run into trouble. That's why I was hoping to find a way to cause the return calcs to be ever so slightly different, hence the reason I tried using the return formula then adding +row()/1000000000 on to the end.

  9. #9
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    Re: Duplicate Data ranking issue

    I've attached a new example which might help clarify where I 'm having the issue. I highlighted the duplicate ticker symbols that I get with the lookup formula I'm using. Hopefully this helps explain the situation better

    Thanks!
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Duplicate Data ranking issue

    Thank you for the clarification - give the new attachment a look. I use the following (array-entered) in C4:

    =LARGE(Sheet2!$C$2:$C$51+0.0000001*ROW(Sheet2!$C$2:$C$51),Sheet1!A4)

    And in D4 (non-array):

    =INDEX(Sheet2!$B$2:$B$51,10000000*(C4-LARGE(Sheet2!$C$2:$C$51,Sheet1!A4))-1)
    Attached Files Attached Files

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Duplicate Data ranking issue

    Or this:

    the %, an array formula:

    =LARGE(Sheet2!$C$2:$C$51+1/(ROW(Sheet2!$C$2:$C$51)*10^12),$A4)


    the ticker, also an array formula:
    =INDEX(Sheet2!$B$2:$B$51,MATCH(Sheet1!C4,Sheet2!$C$2:$C$51+1/(ROW(Sheet2!$C$2:$C$51)*10^12),0))

    ..Just to prove that I hadn't forgotten about you. called away to otther tings!!
    Attached Files Attached Files

  12. #12
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Duplicate Data ranking issue

    Hi

    You can use Aggregate when you on ms 2013?
    Aggregate only work from 2010 onward, not before?

    Sheet1 D4
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    enter then copy down

    Regard
    To help you by my post? it would be nice to click on to say "Thank you".
    If you are happy with a solution to your problem?
    Click Thread Tools above your first post,
    select "Mark your thread as Solved".

  13. #13
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    Re: Duplicate Data ranking issue

    Works Great!! Thanks so much

+ 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. [SOLVED] Ranking issue.
    By GondrandUK in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-18-2015, 09:31 AM
  2. Ranking Issue
    By gamefreak in forum Excel General
    Replies: 1
    Last Post: 12-02-2014, 01:00 PM
  3. Unique data ranking of duplicate data
    By noobiexcel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-04-2014, 12:26 PM
  4. Vlookup issue - duplicate data
    By Deanoz in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-19-2012, 01:13 AM
  5. Ranking Issue
    By IdRatherBeCoding in forum Excel General
    Replies: 2
    Last Post: 05-23-2011, 11:28 AM
  6. Call Top3 based on duplicate data and ranking info
    By Sophyex in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-19-2011, 01:24 PM
  7. Ranking Issue
    By acg in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-11-2007, 05:28 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