Monday, July 20, 2009

Filter and Sort Columns


Filtering and Sorting based on a particular column’s values are the most commonly used features in Excel. Continuing with the same workbook used by me in some previous examples (shown below), we can see various ways in which this sheet can be filtered.The most commonly used option for filtering and sorting columns is by using the Auto Filter. Select all the columns that you may need to filter your data on (here I choose Age and Gender) and then choose the option Data --> Filter --> AutoFilter.
Now, you have the filter option available on the required columns. Click on the drop down arrow and choose the required data based on which you want to filter. For example, I would be interested in the females in the list and hence, I would choose Females in the drop. The filtered result would look like this:
Now, I want to sort them on the ascending order of age. So, I would first remove the filter that I have applied on the Gender column and then choose ‘Sort Ascending’ in the Age filter. The result would look like this:
To remove a filter, just to choose (All) in the filter. It will show all the results.

If you want just the users who are between 30 and 40 years of age, select (Custom..) from the filter drop down and in the new window, provide the filter criteria.
Another way of sorting data is by using the Sort option. Select all the columns in the sheet and then choose Data --> Sort…

In the resultant window, provide your sort criteria. Here, I am sorting the users by the first name first and then their gender and then their age.
In this way, you can choose different filter criteria based on your needs.