How to 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:


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
How to Randomly Select Names in Excel
How to Randomly Select Cells Based on Criteria in Excel

Leave a Reply

Your email address will not be published. Required fields are marked *