To generate a random list without repeats in Excel, the fastest method is to use the =SORTBY(range, RANDARRAY(ROWS(range))) formula. This approach takes an existing list of items and shuffles them into a random order, ensuring every original item appears exactly once without any duplicates.

Generating random numbers or selecting names from a list is a common task for giveaways, assigning tasks, or creating randomized test groups. While the standard RANDBETWEEN function is useful, it often produces the same number multiple times. To avoid this, you must create a system that "shuffles" a set of unique values rather than picking numbers in isolation.

What You'll Need

  • Microsoft Excel (Office 365 or Excel 2021 versions are required for the dynamic array functions used in the primary method).
  • A pre-existing list of the items, names, or numbers you wish to randomize.

Step-by-Step

  1. Prepare Your Source List: Enter the items you want to randomize in a single column. For example, if you have 10 names, list them in cells A2 through A11.
  2. Select the Output Cell: Click on the cell where you want the randomized list to begin (e.g., cell C2).
  3. Enter the Formula: Type the following formula into the cell: =SORTBY(A2:A11, RANDARRAY(ROWS(A2:A11))).
    • A2:A11 is the range containing your original list.
    • ROWS(A2:A11) tells Excel how many items are in your list so it knows how many random numbers to generate.
    • RANDARRAY creates a list of random decimals.
    • SORTBY re-orders your original list based on those random decimals.
  4. Press Enter: Because this is a dynamic array formula, Excel will automatically "spill" the results downward, filling the cells below C2 with your unique, randomized list.
  5. Freeze the Results (Optional): By default, Excel recalculates random functions every time you edit any cell in the workbook. To stop the list from changing:
    • Highlight the randomized list.
    • Copy the cells (Ctrl + C).
    • Right-click the same area and select Paste Values (the icon with "123").

Common Mistakes

  • Using RANDBETWEEN for lists: Many users try to use =RANDBETWEEN(1, 10) repeatedly in a column. This will almost always result in duplicates because each cell calculates independently of the others.
  • Forgetting to Paste Values: If you leave the formula active, your "random" winner or selection will change every time you type a new entry elsewhere in the sheet, which can lead to confusion or disputes.
  • Incorrect Range References: If the range in the SORTBY part (A2:A11) does not match the range in the ROWS part (A2:A11), Excel will return a #VALUE! error because the arrays are different sizes.

Tips

  • Dynamic Ranges: If you frequently add names to your list, convert your source data into an Excel Table (Ctrl + T). You can then reference the table name in your formula, and the randomizer will automatically include new rows.
  • Randomizing Numbers: If you don't have a list but need random unique numbers (e.g., 1 to 100), use =SEQUENCE(100) in column A to generate the numbers 1-100 instantly, then apply the SORTBY method to that column.
  • Picking a Single Winner: If you only need one random item instead of a full shuffled list, wrap the formula in INDEX: =INDEX(SORTBY(A2:A11, RANDARRAY(ROWS(A2:A11))), 1). This returns only the first item from the shuffled list.

Troubleshooting

If the process does not go as planned, try these steps in order:

  1. Check for #NAME? Error: This usually means your version of Excel is too old to support RANDARRAY or SORTBY. If you are using Excel 2019 or older, these functions do not exist. You will need to use the "Helper Column" method: create a column of =RAND() next to your data, then sort the data by that column.
  2. Check for #SPILL! Error: This happens when there is already data in the cells where the randomized list is trying to appear. Clear the cells below and to the right of your formula cell to give the results room to expand.
  3. Verify Range Match: Ensure that both arguments in the formula refer to the exact same number of rows. If one is A2:A11 and the other is A2:A10, the formula will fail.

Frequently Asked Questions

Can I do this in older versions of Excel?

Yes. If you don't have SORTBY, create a "Helper Column" next to your list using the =RAND() formula. Drag it down for all rows, then use the Data > Sort menu to sort your list based on that random column.

Does the list change every time I click?

Yes, random functions in Excel are "volatile." They recalculate whenever the worksheet changes. To lock the list, copy the results and use Paste Values.

Can I randomize a horizontal row instead of a column?

Yes. Use the same formula, but replace ROWS with COLUMNS: =SORTBY(A2:Z2, RANDARRAY(COLUMNS(A2:Z2))).

How do I pick 3 random names without repeats?

Use the SORTBY formula to shuffle the entire list, then simply take the top three results from the resulting spill range.

Will this work with a list of 10,000 items?

Yes, though very large datasets may cause a slight lag during recalculation. For extremely large lists, the "Helper Column" and manual sort method is often more performant than a volatile formula.