+ Reply to Thread
Results 1 to 2 of 2

Prevent duplicates when selecting random string from list

  1. #1
    Registered User
    Join Date
    01-30-2020
    Location
    Sweden
    MS-Off Ver
    MS Office Professional Plus 2019
    Posts
    1

    Question Prevent duplicates when selecting random string from list

    Hello!

    I have created a function for my project that randomly selects a string from a list. Depending on the value of the adjacent cell, my function chooses which list to randomly select a string from. It is working great but I really need to configure it so that it does not select a string that has already been selected (no duplicates). I have a column for the value that determines which list it will select a string from and I have a column for the function that randomly selects a string. What I also have is a column where I manually enter the string that was randomly selected so that it stays locked. I was thinking that perhaps this column could be useful to prevent duplicates but I do not know how.

    I have attached the workbook. Column N, P & Q are those that I mentioned above. The lists are located on the third sheet. If anyone is able to figure out how to prevent duplicates I would be immensely grateful.

    Note: I tried to give the list rows random values in an adjacent column but that method did not work in my case. I am decently certain I did it right.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,542

    Re: Prevent duplicates when selecting random string from list

    Hello tulipxde and Welcome to Excel Forum.
    This proposal employs a helper column which may be moved and/or hidden for aesthetic purposes.
    The helper column on the Lagerplatser sheet (R) is populated using: =RAND()
    The formula on the Automatiska påfyllnader sheet that displays the strings is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that once the formula has displayed the strings you may select the range (i.e. P3:P10), press the Ctrl + c keys then press the Ctrl + Alt + v keys, select Values and OK.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] How do you prevent duplicates when using random number generator?
    By Aurbo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-07-2015, 03:48 PM
  2. [SOLVED] Random selecting 20 items base on criteria with no duplicates
    By emina002 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-19-2013, 04:50 AM
  3. Prevent duplicates from a drop down list
    By jame24 in forum Excel General
    Replies: 1
    Last Post: 06-08-2012, 02:14 PM
  4. Random choice from a list without duplicates
    By itwasgood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-16-2010, 12:19 AM
  5. Random from list...without duplicates
    By HuskerBronco in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-23-2010, 08:17 AM
  6. Selecting a Random value from a list
    By WrestlingCoach in forum Excel General
    Replies: 4
    Last Post: 01-10-2008, 09:36 AM
  7. Selecting a Set of Random Numbers, Avoiding Duplicates
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-29-2005, 10:58 AM

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