+ Reply to Thread
Results 1 to 3 of 3

Using Index, Rank, and Countif to generate Random Name and it is creating duplicates

  1. #1
    Forum Contributor
    Join Date
    01-06-2015
    Location
    Huntsville, AL
    MS-Off Ver
    Office 365
    Posts
    185

    Using Index, Rank, and Countif to generate Random Name and it is creating duplicates

    I am needing to randomly choose names without creating duplicates. Once I have chosen the name I will have a macro to remove it from the possible list of names. The problem I am having is it is choosing duplicate names with from the list of remaining names? I have (3) tabs. The one labeled Names is the master list. The next is called Filtered Names. It is just filtering the names over that haven't been selected. the formula that I am using to select the random name is
    Please Login or Register  to view this content.
    I am attaching a screen shot as well as the example sheet. Can someone please tell me what is wrong with the formula I have?Duplicate Names.png I am wanting it to show random names in Column C on the Filtered Names sheet without any being duplicates. The less names it shows the worse it gets. Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Using Index, Rank, and Countif to generate Random Name and it is creating duplicates

    Hello Chris - you could probably remove the COUNTIF function altogether, you'd only need that if two of the numbers generated by RAND() are identical (unlikely given they use 15 significant digits) but to cater for that remote possibility COUNTIF should refer to column B - like this:

    =IF(A2="","",INDEX($A$2:$A$101,RANK(B2,$B$2:$B$101,1)+COUNTIF($B$2:B2,B2)-1))
    Audere est facere

  3. #3
    Forum Contributor
    Join Date
    01-06-2015
    Location
    Huntsville, AL
    MS-Off Ver
    Office 365
    Posts
    185

    Re: Using Index, Rank, and Countif to generate Random Name and it is creating duplicates

    Thank you more than you know!!! This has been giving me a fit for a day or two. Works like a charm!!!

+ 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: 3
    Last Post: 09-22-2016, 09:40 AM
  2. Generate random list with no duplicates
    By imgrieve in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2015, 06:48 AM
  3. Need to generate random numbers with no duplicates
    By mustbe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-27-2015, 05:32 PM
  4. [SOLVED] generate random results, removing only SOME duplicates
    By jrosko1 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-04-2013, 12:00 PM
  5. generate random results, removing only SOME duplicates
    By jrosko1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2013, 04:54 PM
  6. Auto-Generate random set of four numbers without duplicates?
    By adrien23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2011, 06:03 PM
  7. How to generate sets of random numbers without having duplicates
    By William in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-06-2006, 12:35 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