Chapter 4. Change your Point of View: Sort, zoom, and filter

image with no caption

The details of your data are tantalizing.

But only if you know how to look at them. In this chapter, you’ll forget about formatting and functions and just focus on how to change your perspective on your data. When you are exploring your data, looking for issues to investigate, the sort, zoom, and filter tools offer surprising versatility to help you get a grip on what your data contains.

Political consultants need help decoding their fundraising database

The Main Campaign is working for the Dataville mayor and wants to solicit his supporters for money.

Your client is a super-intense, super-demanding politico. But the good news is that the data is pretty clean (that’s always a relief!), and if you can help this group organize their contributor list, you’ll have scored a huge account.

image with no caption

The data is a list of their contributors’ donations from the past year. And while the data is of a high quality, at over 4,000 rows, there’s quite a lot of it!

Find the names of the big contributors

Getting in touch with their most passionate (that is, most generous!) contributors is a big deal. The small fries are important, but before anything else, the Main Campaign needs to get in touch with the big contributors.

image with no caption

Sort changes the order of rows in your data

The Sort buttons are a useful tool that enables you to reshuffle the order of the rows in your data. The Sort buttons can be found under the Data tab of the Ribbon.

image with no caption

To sort ascending means to order your data from first to last or smallest to largest, and to sort descending means to do the opposite.

There are many occasions where you’ll want to use Sort to change the order of your data, but Sort is especially useful when you’re looking at data for the first time and trying to get a feel for what’s in it.

Sorting shows you different perspectives on a large data set

When you look at data for the first time, it’s a good idea to sort by different columns to look for visible patterns.

image with no caption

Watch it!

Excel can figure out which columns are in your table...usually.

If Excel doesn’t sort all your columns together, it can wreck your database. Always save your data first and check it after sorting to make sure you and Excel got it right.

Let’s see what the Main Campaign has to say about this newly organized data....

image with no caption

Nice work on sorting that data.

Now you can see how many large donations fall into each zip. Let’s see what the client thinks....

image with no caption

Looking at the data is a good thing. It’s a nonobvious but important part of data analysis, and your client is right to want to be able to see the data better, not just group it correctly. What should you do?

image with no caption

See a lot more of your data with Zoom

Sometimes you need to focus on a small part of your data. Why not zoom way in?

image with no caption

Sometimes you need to focus on the big picture. In that case, zoom way out.

image with no caption

Getting the big picture through zooming out is not about straining your eyes (if you feel your eyes strain, you should be zooming in!). It’s about looking at as much of the whole picture of your data as you can see at once. To zoom, click the View tab to get to the Zoom button.

image with no caption

Your client is impressed!

image with no caption

Looks like Mr. Demanding is impressed! Without running any sort of function or doing any sort of formatting, you were able to sort and zoom your way to a greater clarity about his data.

But now he wants to focus on just one subset of the data. You know you can’t just delete the data he doesn’t want to focus on. How can you look at just the data he wants without changing the rest of the data?

Filters hide data you don’t want to see

Sorting and zooming have given you a rich big-picture perspective, but sometimes you want to look at just a slice of data. Try clicking on the Filter button.

image with no caption

Filters are convenient because they give you a way to hide the data you don’t want to see. It’s still very much there; it’s just conveniently out of the way. And just as with sorting, when you’re exploring a new data set for the first time, it’s a great idea to run filters to look at various subsets of the data.

Do this!

Select a cell in the column you want to filter and click Filter. What happens?

Use Filter drop boxes to tell Excel how to filter your data

When you click on the Filter button, Excel puts a drop box on every column in your data table.

image with no caption

When you click on one of the drop boxes, Excel gives you a bunch of options for filtering the data based on the data in that column.

image with no caption

Each of the seven zip codes represented in your data set are listed in the Filter drop box for ZIP. Because they’re all checked, Excel is showing all of them. But you only want to see 78723....

An unexpected note from the Main Campaign...

image with no caption

The Main Campaign is delighted with your work

image with no caption

This is kind of ambiguous.

A guy named Alex who’s a big giver? There could be tons of people in the database named Alex! This could be like finding a needle in a haystack. Except that we have a potent tool: filters.

Donations are pouring in!

The Main Campaign was able to get in touch with Alec, and the lists you isolated have proven to be really valuable for the Dataville mayor’s fundraising efforts!

image with no caption

Get Head First Excel now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.