Can You Use Excel to Randomize a List? Yes, Here’s How

How-to basics · Updated November 19, 2026

Yes. In Excel for Microsoft 365, you can randomize a list by assigning each item a random number and sorting by it, or by using a dynamic-array formula. For a quick shuffle, put =RAND() beside each item, fill it down, then sort the entire list by that helper column.

What Randomizing a List Does

Randomizing, or shuffling, changes the order of the entries without changing the entries themselves. If a list contains five names, a shuffle should leave you with the same five names, each appearing once, but in a different order. The same approach works for product names, classroom activities, survey questions, or rows in a small dataset.

It is important to distinguish shuffling from choosing a random item. A shuffle rearranges every entry. A random selection returns only one or more entries from the list. You can use a shuffle to make a selection without replacement: shuffle the list, then take the first few rows. If you need to select the same entry more than once, that is sampling with replacement and calls for a different method.

Excel’s random functions generate pseudorandom values using a formula, rather than physically mixing entries. For everyday tasks such as making a practice order or assigning a casual activity, that is usually sufficient. A spreadsheet shuffle should not be treated as a secure lottery or a cryptographic random process.

Method 1: Shuffle with a RAND Helper Column

This method works in current Excel and in many older versions. It is easy to inspect and gives you control over how the full rows are sorted.

  1. Put the items in one column, with a heading in the first row if you have one. For example, enter five names in A2:A6 and put Random key in B1.
  2. With names in A2:A6, enter this formula in B2: =RAND(). It returns a decimal from 0 up to, but not including, 1.
  3. Fill the formula down through B6. Each row now has a random key. With five names, you will have five keys and five corresponding list entries.
  4. Select both columns, including all five names and their keys. Choose Data > Sort, indicate that the data has headers if applicable, and sort by Random key from smallest to largest.
  5. Read the names in their new order. If you no longer need the helper column, you can remove it after the shuffle is fixed as values.

For example, if the keys happen to be 0.82, 0.14, 0.63, 0.31, and 0.47 from top to bottom, sorting smallest to largest puts the second name first, the fourth second, the fifth third, the third fourth, and the first last. The actual numbers and resulting order will vary; that is the point of the randomization.

Always sort the list and its helper keys together. Sorting only column B would separate the keys from the names they belong to. If your entries have other details in adjacent columns, select or include those columns too, so each record stays intact.

Method 2: Use SORTBY and RANDARRAY

Excel for Microsoft 365 also supports a formula-based shuffle that spills a reordered list into nearby empty cells. It leaves the source list where it is, which can be convenient when you want to keep an original copy.

With the items in A2:A10 and enough blank cells below or beside the formula for the results, enter: =SORTBY(A2:A10,RANDARRAY(ROWS(A2:A10)))

ROWS counts the entries in the source range, RANDARRAY generates one random key per entry, and SORTBY returns the source values ordered by those keys. The result contains nine items because A2:A10 has nine rows. Each item appears once, but the order changes when Excel recalculates. The source range is not rearranged.

For complete records, sort the entire row range rather than only the name column. With names, departments, and dates in A2:C10, use: =SORTBY(A2:C10,RANDARRAY(ROWS(A2:A10)))

This returns the rows from A2:C10 in a random order, keeping each name, department, and date together. The formula needs a clear output area; otherwise Excel may show a spill error because existing content blocks the results. SORTBY and RANDARRAY are available in Microsoft 365 and Excel 2021 or later. If a workbook will be opened in an older Excel version, the helper-column method is more compatible.

How to Keep a Shuffle from Changing

RAND and RANDARRAY are volatile functions: their results can change when Excel recalculates the workbook. Recalculation may happen after you edit a cell or when the workbook is recalculated, so a list that looked randomized a moment ago may move again. A live formula is useful if you want a fresh shuffle, but it is inconvenient when you need to preserve a chosen order.

To keep the helper-column result, copy the randomized list and use Home > Paste > Paste Values in the destination. This replaces formulas with their current displayed results. You can also copy the helper keys and paste them as values before sorting; then the sort keys will not regenerate. For a SORTBY result, copy the spilled output and paste values into another area, or into a separate workbook, before making later edits that might recalculate it.

Keep an untouched copy of the original list if you may need to restore it. Pasting values preserves the current order, but it does not preserve a formula that can generate another shuffle. If you want to rerun the process later, keep the source data and repeat the shuffle using a fresh set of random values.

Randomizing Rows, Tables, and Lists with Duplicates

When each line represents a record, randomize complete rows, not individual cells. For example, if a person’s name is in column A and their assigned group is in column B, sorting only the names would scramble the relationship between the person and the group. Include all columns belonging to a record when you sort, or give SORTBY the full record range.

If the source is an Excel table, include its data columns in the sort so each row remains a record. Do not include unrelated notes or totals in a way that could make them move independently. A header row should remain a header: in the Sort dialog, identify that the data has headers, or select only the data rows when using a helper column.

Duplicate values are not automatically removed. If the list contains “Alex” twice, a shuffle keeps both occurrences. That is correct when the duplicates represent separate entries, such as two tickets bearing the same label. If you intended each distinct value to appear only once, remove or resolve duplicates first; shuffling does not deduplicate a list.

Choosing the Right Method

Use the helper-column method when you want compatibility, visibility, or a straightforward way to sort a larger table. The random key is visible beside each row, and you can keep or delete it after the sort. It is also a good choice when you want to use Excel’s regular Sort controls rather than spill a formula into a new range.

Use SORTBY with RANDARRAY when you have a supported Excel version and want a formula to display a shuffled copy while leaving the original list untouched. It is concise and updates on recalculation. Its main trade-offs are version compatibility, the need for empty spill space, and the fact that the order is not fixed until you paste values.

  • For a one-time shuffle in a broadly compatible workbook, use RAND in a helper column.
  • For a live shuffled copy in Microsoft 365 or Excel 2021 and later, use SORTBY with RANDARRAY.
  • For a small selection without replacement, shuffle first and take the required number of rows from the top.
  • For a repeatable or auditable draw, record the final values and the procedure used; do not assume a volatile formula preserves the original draw.

Common Problems and Misconceptions

A common mistake is sorting just the random-number column. That changes the keys’ order but leaves the original list in place, so the items have not been shuffled. Select the full data range before sorting and confirm the sort dialog is using the helper column as its key.

Another issue is a formula that appears not to change. RAND may produce a different value when the workbook recalculates, but it does not necessarily redraw continuously on screen. You can recalculate the workbook using Excel’s calculation controls. Remember that a recalculation can also change other volatile formulas, so paste the result as values if the current order matters.

Random keys can theoretically tie. With a short list this is unlikely, but it is possible; Excel then has no unique random key to distinguish the tied rows, and their relative order may be determined by the sort behavior. For ordinary list shuffling, this is rarely consequential. If you need a documented, repeatable selection process, retain the final selection and describe how it was produced rather than relying on a changing formula as a permanent record.

A random-looking order is not proof that every outcome had exactly the same chance in a specialized statistical sense. Excel’s functions are designed for spreadsheet calculations, not for security-sensitive draws. For a casual classroom or planning shuffle they are practical; for a regulated drawing, formal research, or valuable prize, use an appropriate process and follow its applicable rules.

Using a Shuffle to Select a Sample

To choose a few entries without replacement, first randomize the complete list, then take the required number from the top. For example, shuffle 30 participant rows and use the first five rows as a five-person sample. Because each row is included once in the shuffled range, the same row cannot occupy two of those first five positions.

For a small selection with replacement, each draw must be allowed to pick from the full source list again, so shuffling once and taking the first few rows is not the same method. A simple approach is to use an index formula with a random integer for each draw, but repeated results are possible by design. Be clear about whether repeats are allowed before choosing a technique, especially when the list represents people or inventory.

Frequently Asked Questions

Does Excel have a shuffle button?
Excel does not provide a dedicated one-click Shuffle command for a list. The usual approach is to generate random keys with RAND and sort, or use SORTBY and RANDARRAY in a supported version.

How do I randomize a list without changing the original?
Use SORTBY and RANDARRAY to return a shuffled copy in an empty range, with the source list left in place. Alternatively, copy the source to another location first, then randomize the copy with a helper column.

Why does my randomized list keep changing?
RAND and RANDARRAY recalculate, so their keys and the resulting order can change. Copy the result and choose Paste Values to preserve the current shuffle.

Can I randomize a list in Excel without a formula?
You can use a sorting method only after you have some key to sort by. Excel’s standard sort does not itself create random values, so the usual no-code alternative is to add random numbers with RAND and sort by that column; RAND is still a formula.

Can Excel randomly choose several names?
Yes. Shuffle the full list and take the first required number of entries for a selection without replacement. If repeats are allowed, use a method that draws independently from the original list instead.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.