Sorting data in Google Sheets can be a breeze once you know the right steps. Today, we're going to tackle a common task: sorting a column by last name. This can...
Sorting data in Google Sheets can be a breeze once you know the right steps. Today, we're going to tackle a common task: sorting a column by last name. This can be particularly useful when you have a list of contacts, students, or employees, and you want to organize them alphabetically by their last names.

Before we dive into the sorting process, ensure that your data is clean and formatted correctly. Google Sheets can handle mixed data types, but for a smooth sort, it's best to have all last names in a single column and formatted as text.

If your last names are in a single column, the sorting process is straightforward. Here's how you can do it:

1. **Select the column** you want to sort. To do this, click on the header of the column (e.g., if your data starts from A2, click on A1).

2. **Click on 'Data'** in the menu, then select '**Sort A โ Z**' or '**Sort Z โ A**' depending on your preference. This will sort your column in ascending (A โ Z) or descending (Z โ A) order.
3. **Confirm the sort** by clicking 'Yes' when prompted. Your column will now be sorted by last name.

2. **Click on 'Data'** in the menu, then '**Sort**'.
3. **In the 'Create a sort' window**, ensure your 'Sort by' column is correct, and select '**Last name**' from the dropdown. Choose your preferred '**Sort order**' (A โ Z or Z โ A), and click '**Sort**'.
4. **Confirm the sort** by clicking 'Yes' when prompted. Your column will now be sorted by last name.

If your column contains both first and last names, you'll need to extract the last names first. Here's how you can do it:




















1. **Select the column** with first and last names. Again, click on the header of the column.
2. **Enter the following formula** in a new column: `=ARRAYFORMULA(IFERROR(REGEXEXTRACT(A2:A, "\w+$")))`. This uses the REGEXEXTRACT function to pull the last name from each cell. The `\w+$` part of the formula matches the last word in each cell, which should be the last name.
3. **Press Enter** to apply the formula. Your last names should now be in the new column.
4. **Follow the steps** from the previous section to sort the new column of last names.
2. **Enter the following formula** in a new column: `=ARRAYFORMULA(IFERROR(SPLIT(A2:A, " ")))`.
3. **Press Enter** to apply the formula. This will split each cell into an array of words, with the last word (last name) in the second position of the array.
4. **Enter the following formula** in another new column to extract the last name: `=ARRAYFORMULA(IFERROR(INDEX(B2:B, 0)))`.
5. **Press Enter** to apply the formula. Your last names should now be in the new column.
6. **Follow the steps** from the previous section to sort the new column of last names.
And there you have it! You've now mastered the art of sorting a column by last name in Google Sheets. This skill will serve you well in many data management tasks. Happy sorting!