+ Reply to Thread
Results 1 to 8 of 8

ranking duplicate values by date

  1. #1
    Registered User
    Join Date
    11-24-2012
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    27

    ranking duplicate values by date

    I have a series of patient identifiers. For many there are multiple rows for the same patient. Each row has a date, so Id like to create a new column which will be a number corresponding to rank in time for that row. For some patients there would only be one entry (row) which will be a 1. For others there will be multiple rows and id like them to be to ranked 1-10 (or however many) according to time, ie. first entry 1, last entry 10.

  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: ranking duplicate values by date

    Will you please attach a sample Excel workbook? Please don't attach a picture of one.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    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.
    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 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: ranking duplicate values by date

    I'm not sure what you mean by ranked in time... Can you explain.

    This array formula will return a list of unique patient IDs (in E2, copied down):
    =IFERROR(INDEX($A$2:$A$30,MATCH(0,INDEX(COUNTIF($E$1:$E1,$A$2:$A$30),0),0)),"")

    If what you want to do is count the number of visits (???), In F2, copied down:
    =IF(E2="","",COUNTIF(A:A,E2))


    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-24-2012
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: ranking duplicate values by date

    here is sample data and I have manually filled in column 3. So if we look at row 24, we can see that this is the 4th entry (by date) for patient a

    many thanks
    Attached Files Attached Files

  5. #5
    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: ranking duplicate values by date

    Use
    =COUNTIF($A$2:A2,A2)

    Have you made a mistake at C15 (should be 5)

  6. #6
    Registered User
    Join Date
    11-24-2012
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: ranking duplicate values by date

    Not working
    'the formula in this cells refers to a range that has additional numbers next to it'
    if i ignore this error nothing changes
    if I click on a cell then press return it then recalculates and gives the correct result
    bit odd

  7. #7
    Registered User
    Join Date
    11-24-2012
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: ranking duplicate values by date

    just clicked 'save as' and it took the opportunity to recalculate all the values correctly
    so all sorted now
    thanks Glenn

  8. #8
    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: ranking duplicate values by date

    Check that you do not have formulas calculation options set to manual... It should be at automatic (normally...).

    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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 with duplicate values while ignoring zeros and negative values
    By mfortier3 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-06-2017, 04:43 AM
  2. Ranking values and ranking duplicates the same rank
    By 302arpks in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-05-2015, 01:50 PM
  3. [SOLVED] vba code to find Duplicate Values and Newest date(Max) date in the Corresponding Column(ce
    By Pradu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2013, 05:20 AM
  4. Ranking that allows and returns duplicate text values
    By Nattio in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-03-2013, 04:14 PM
  5. Ranking list with duplicate values
    By joedrummer in forum Excel General
    Replies: 2
    Last Post: 06-21-2012, 04:13 PM
  6. ranking duplicate values with secondary value
    By awaring in forum Excel General
    Replies: 6
    Last Post: 06-09-2010, 06:15 PM
  7. Replies: 6
    Last Post: 06-01-2010, 06:19 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