Microsoft Office Tips for Word and Excel

Advanced Microsoft Excel – How to Use Sort and Filter

What are Sort and Filter?

Sorting and filtering are two entirely different concepts – almost opposite. But both allow you to look at your spreadsheet in different ways. Sorting allows you to see all your information a specific way. For example, the spreadsheet below is sorted by title:

Excel Spreadsheet with columns including Director Name, Date, Title, Edition, and Number of Discs

Films by Title Order

How to Sort

However, to sort by date, use Excel’s Sort and Filter Feature In-line image of Sort & Filter Button in Excel.

  1. Click on “Sort and Filter”.
  2. In the Sort and Filter Context Menu, click on “Custom Sort” – this will give you the most options.
  3. In the “Sort By” field, click on the down arrow to see the options for sorting.
  4. Sort Tool with Column - Sort by circled in red and blue arrow pointing to the down arrow

  5. Once clicked, a list will appear of the column headings of the spreadsheet.
  6. Sorting_menu_coices-showing

  7. Choose the item for sorting, for example, rather than sorting by title – sort by date.
  8. Sorting menu in excel showing "date" as the sort value

  9. Click OK to confirm the choice.

Excel will now re-organize the spreadsheet to display by the chosen field.

Excel spreadsheet of films by date order

This is simply a reorganization of data. Everything that was there when the list was displayed in Title order is still there, but displayed by Date.

How to Perform a Multi-Level Sort

Excel also allows multi-level sorts, which can be quite powerful if you understand what is going on. In a multi-level sort, think of each additional level as “and then by”. To start, I’ve reorganized my spreadsheet by Director Name – just so it is in a neutral list to start.

Film spreadsheet sorted by director name

Now, let’s create a list by Date, then alphabetical by Title.

  1. First, click on “Sort and Filter”, then “Custom Sort”.
  2. Change “Director Name” to Date. For your own spreadsheet, pick any column to sort by.
  3. Now click “add a level”, to add the next level of sorting. Remember, Excel will sort first by the first thing chosen, and then by the next level.
  4. Add Level button circled in Sort Tool

  5. Another Sort By line will pop-up, as before click the down arrow to choose the column to sort by.
  6. Excel Sorting Tool showing two levels - Date, Then Title

  7. Click “OK”.

The result is a list sorted by Date first and then by Title.

Film list sample by date then title

It’s important to consider how you want to view data, especially with multi-level sorts. This sort list the Date first, so you need several items with the same date, before the second level goes in to affect – the title. So, for example, if you had a product list and every product had a unique ID number, sorting by “Product ID” and then “Product Name” wouldn’t be terribly useful – since Product ID was unique – you’d simply have a list by Product ID. If you reversed that idea, and listed by Product Name then Product ID, the results would depend on the products you have – if there are several of the same product but by different companies, thus having different IDs, a list by Product ID and then by Product Name might be useful. (For example, if you had a high-end grocery and sold different types of cola and each had it’s own unique Product ID.)

Excel will allow up to three levels of sorting, but remember that you want both repeated information and unique information for the sort to be meaningful. An example of a good three-level sort, might be if you had a list of all your musical CDs. You could sort by (1) Genre or Type of Music and then by (2) Artist – the band or singer, and (3) then by album title. Since you are likely to have several types of genres in your music collection, many artists, but each album has a unique title, and in the cases where titles might be the same, the artist is probably different. Such a three-level sort should work.

How to Filter

Filtering is almost the opposite of sorting. Whereas with sorting you see all information presented in different order – with filtering you are looking to “pull out” only certain types of information.

This sample excerpt spreadsheet of films in my DVD collection includes the genre of the film.

Sample film list genre included

To turn on filtering, click the sort and filter button on the ribbon, then click filter.

Sort and Filter - Filter circled on context menu

Once filter is turned on you will see little arrows next to each column.

Excel with filtering turned on

Click an arrow, such as the one next to “genre” in this example, and a “pick list” will appear showing all the categories in that column.

Excel filter by Genre, Everything Selected

By default, every unique value is listed. To apply a filter, uncheck all but the information you want to see.

Excel filtering with only "Musical" selected

Then click “OK”.

Filtered list of musicals

As you can see, rather than listing all films, the list is now limited to only musicals. You can tell the list is filtered because (a) the row counter on the far left now shows skips in the number sequence, indicating lines not shown, and (b) the filter symbol shows on the “Genre” column header.

In order to see the whole list again, go back to the filter symbol, click the arrow and choose “Select All”.

Select all - check marks appear next to each value

To turn off filtering entirely, go back to the sort and filter button, “filter” will be highlighted, click to turn it off.

Filtering is best used to view only a certain class of information.

Also, if you have a Yes/No column in your spreadsheet, you can filter to only show “yes” or only show “no”. You can even filter to only show blanks or to not show blank lines, by adding and removing check marks in the filter list.

Filtering: Yes, No, Blanks Sample

“Yes/No” filtering can be very powerful, and I use it at work all the time.

In this article, I’ve shown how to use sorting and filtering in Excel. Sorting and filtering are very useful and powerful tools for viewing the data in a spreadsheet. Mastering them will help you to get more out of your spreadsheet data.

Advertisements

2 thoughts on “Advanced Microsoft Excel – How to Use Sort and Filter

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s