How can I shuffle rows in Excel?

Shuffling rows in Excel refers to rearranging the order of rows in a spreadsheet randomly. This feature is useful for data analysis and organization, as it allows for a different perspective on the data. To shuffle rows in Excel, one can use the “Sort” function or the “RAND” function in the formula bar. The “Sort” function allows for customizing the sorting criteria, while the “RAND” function generates a random number for each row, which can then be used to sort the rows in a random order. Both methods offer a quick and easy way to shuffle rows in Excel, providing a more efficient and effective approach to managing data.

Shuffle Rows in Excel (With Example)


Often you may want to randomly shuffle rows in Excel:

Excel shuffle rows

Fortunately this is easy to do by using the RAND() function to create a helper column with random numbers for each row and then by sorting on the helper column.

The following step-by-step example shows how to shuffle rows in Excel in practice.

Step 1: Enter the Dataset

First, let’s create the following dataset that contains information about various basketball players:

Step 2: Use RAND() to Create Helper Column

Next, type the following formula into cell D2 to generate a random value between 0 and 1:

=RAND()

We can then click and drag this formula down to each remaining cell in column D:

Step 3: Shuffle the Rows

We can now “shuffle” the rows in the dataset by sorting the rows based on the values in the Random Value column.

To do so, highlight the cell range A2:D11, then click the Sort icon within the Sort & Filter group in the Data tab along the top ribbon:

In the new Sort window that appears, choose Random Value in the Sort by dropdown menu:

Once you click OK, the rows will be sorted from smallest to largest based on the values in the Random Value column:

The original rows in the dataset have now been “shuffled” in a random order.

Note: Feel free to delete the Random Value column after you’ve sorted the rows since you no longer need it.

Additional Resources

The following tutorials explain how to perform other common operations in Excel:

How to Select a Random Sample in Excel

x