Organising data effectively is essential when working with Google Sheets. Whether you’re sorting performance figures, class lists, or creating randomised groups, Sheets offers flexible sorting and randomisation tools. In this post, we’ll walk through sorting your data numerically or alphabetically, sorting with and without headers, and look at how to randomise data.
How to sort data without headers
Let’s see how we sort data with this example. Here, we have some exam marks and I want to sort them by the exam marks with the highest at the top and the lowest at the bottom.

1. Select your data, right-click and select View more cell actions > Sort range.
2. Choose the column to sort by, e.g. Column D for the exam marks.
3. Change the sort order from A to Z (ascending) to Z to A (descending).
4. Click Sort to reorder the data.
This is perfect for quickly ranking performance figures.
How to sort data with headers
When your data includes headers, it’s usually best to include the headers when you select the data so you’ll see header names instead of column letters. Here, let’s sort it by exam marks again but we’ll include the headers.

1. Select all the data, including the headers, right-click and choose Sort range.
2. Tick the box for Data has header row.
3. Select the header name from the drop-down, e.g. “Exam marks”.
4. Change A to Z to Z to A and click Sort.
This makes sorting intuitive, as you can refer to header names rather than letters.
How to sort data with multiple criteria
You can sort data by multiple rules, such as sorting by class and then by exam mark within each class, with the highest marks within each class at the top.

1. Select your data, right-click and select View more cell actions > Sort range.
2. Choose the column to sort by, e.g. “Class” and leave it in ascending order, A to Z.
3. Click Add another sort column. Choose “Column D (“Exam marks” and change it to descending order, Z to A.
4. Click Sort to apply both rules.
We can now see the ranking per class.
Using the Data Menu for Quick Sorting
The Data menu offers options for sorting the entire sheet or a specific range.

• Sort sheet sorts the entire sheet based on the selected column.

• Sort range affects only the selected data range.
The Advanced range sorting options takes you to the same dialogue as the right-click menu we saw earlier.
How to randomise data
For tasks like creating random groups, randomisation is useful. Here, I want to randomise a group of students to create a new order they will work in.

1. Select the data to shuffle, such as student names.
2. Right-click and select View more cell actions > Randomise range.
This instantly mixes up your data.
Mastering sorting and randomising in Google Sheets saves time and makes your data more accessible. Whether you’re working with numbers or text, these tools simplify the process.
Check out this video which shows you how to sort data in more detail:
Learn more about using Google Sheets here.
Want to learn more about Google Workspace and Apps Script? The books below are available on Amazon. Just click on a book! (Affiliate links).