Sorting data in Excel can significantly enhance your productivity and analysis capabilities. Today, we're going to explore a common task: sorting selected cells...
Sorting data in Excel can significantly enhance your productivity and analysis capabilities. Today, we're going to explore a common task: sorting selected cells by last name in Excel. This can be particularly useful when you're working with large datasets containing names, such as a list of employees or customers.

Before we dive into the steps, ensure that your data is structured with last names in a separate column. If not, you might need to use the 'Text to Columns' feature or a formula like `=RIGHT(A1,LEN(A1)-FIND(" ",A1))` to extract last names. Now, let's proceed with the sorting process.

Excel provides a straightforward way to sort data. You can sort by one or more columns, in ascending or descending order. Let's start with the basics.

First, select the data range you want to sort. This includes the headers if you want to sort the entire table. Then, click on the 'Sort & Filter' button in the 'Home' tab. This will open the sorting dialog box.

For our purpose, we want to sort by the last name column. In the dialog box, select the column you want to sort by (Last Name) and choose 'Sort A to Z' or 'Sort Z to A' depending on your preference. Click 'OK' to sort the data.
If your data has headers, Excel will sort the entire table. If not, it will sort only the selected range. You can also sort data in place by clicking on the column header and dragging it to the 'Sort & Filter' button.
![[EP 6] Excel Tips Separate First and Last name](https://i.pinimg.com/originals/87/eb/6d/87eb6d654567dd470adbeebc15ff6f64.png)
Sometimes, you might want to sort data by multiple columns. For instance, you might want to sort by last name first, then by first name. To do this, select the first column (Last Name) and choose your sorting order. Then, click on the 'Add Level' button to add another sorting level. Select the second column (First Name) and choose your sorting order. Click 'OK' to sort the data.
Remember, Excel sorts data level by level. So, if you have multiple levels, Excel will first sort by the first column, then sort the resulting data by the second column, and so on.

Sorting data is just one part of the equation. Excel also allows you to filter data based on specific criteria. This can be particularly useful when you want to analyze a subset of your data.
To filter data, select the column you want to filter, then click on the 'Filter' button in the 'Home' tab. This will add a dropdown arrow to the column header. Click on this arrow to open the filter menu. You can then choose to filter by specific values, text that contains, or other criteria.




















Let's say you want to filter names that contain 'Smith'. In the filter menu, select 'Text that Contains', then type 'Smith' in the 'Contains' field. Click 'OK' to filter the data. This will show only the names that contain 'Smith'.
To remove the filter, click on the 'Filter' button again or click on the dropdown arrow and select 'Clear filter from "Last Name"'.
If you want to filter by specific values, select 'Equals' in the filter menu, then type the value you want to filter by. For example, if you want to filter by 'Smith', type 'Smith' in the 'Equals' field. Click 'OK' to filter the data. This will show only the names that are exactly 'Smith'.
You can also filter by multiple values by selecting 'Equals' and then clicking on the 'Select All' checkbox. This will select all the values in the column. Click 'OK' to filter the data. This will show all the names that are exactly 'Smith', 'Johnson', 'Williams', etc.
Sorting and filtering data in Excel can greatly simplify your data analysis tasks. Whether you're working with a list of names, sales figures, or any other data, these tools can help you extract the insights you need. So, the next time you're working with a large dataset, give sorting and filtering a try. You might be surprised at how much easier your tasks become.