« Things that don't work when you save Writer documents in Word's .doc format | Main | Using the Standard Filter »

November 12, 2007

Using the AutoFilter: A useful if slightly twitchy tool

Sooner or later, you're going to get a huge spreadsheet with way too much data to scan visually.

How do you, ahem, filter out what you don't want to see?

One way is to use the AutoFilter.

AutoFilter Basics

Let's say you've got this spreadsheet of employees.

Auto1

You'd like to just take a look at those from Montana, or those with a particular number of years of service. Something like that.

Click somewhere in the data, and choose Data > Filter > AutoFilter.
Auto2_2

You see arrows by all the headings.
Auto3

Click on one  of the arrows, and choose to view all records containing one of the values, or all records containing the top 10, i.e. the ten most frequently occurring values in that column.
Auto4_2

Here are the results for selecting one value for one column.
Auto5

If you choose another value in another column, then you get rows that have the selected value for BOTH columns.

Auto6

Here, I get rows for people who are in Montana, AND in Kalispell. Which works out fine since Kalispell is a city in Montana.

Auto7_2  

However, if I choose to view records for people from Montana, and from Portland (a city in Maine and in Oregon but NOT in Montana), I get nothing.

Auto8

To go back to viewing all the values, select All from the list.

Auto9

Then you get to view all the records again, once you've selected All for any columns you restricted.

Auto10

When you're done and want to get rid of the little arrows, click somewhere in the data, and choose Data > Filter > AutoFilter again. There'll be a checkmark and when you select AutoFilter, it will go away.
Auto11

There's the data the way it was before you started.

Auto12

Issues With AutoFilter

Here's where things get a little twitchy. What if you try to turn off the AutoFilter and you have not selected a cell somewhere within the AutoFilter results?
Iss1

You get this.
Iss2

When you get this, click OK and click somewhere in the data.

Then choose Data > Filter > AutoFilter again. You won't see the checkmark, but that's OK.
Iss3

Then choose Data > Filter > AutoFilter yet again. This time you'll see the checkmark.

Iss4

And then the arrows will disappear and you're back to normal.

Iss5

I also recommend liberal use of the Undo feature, Ctrl Z or click the Undo icon. You can undo at least 20 and possibly more depending on how your system is set up.

Can You Delete Rows When in the AutoFilter Without Deleting the Intervening Data?
I'm glad you asked. Yes, you can. Here's a demo.  Look at the range from row 15, Dan Montbatten, to row 20, Beth Jerlin. They're both from Montana.  In between you've got Jon, Marcus, and Kyle.
Del1

I'm going to view only people from Montana, which includes Dan and Beth but excludes the three rows between.

Del2

Now I'm going to delete Dan and Beth.
Del4

And they go away. However, Jon, Marcus, and Kyle are still there.
Del5

 



Traininglogo




TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/551685/22955944

Listed below are links to weblogs that reference Using the AutoFilter: A useful if slightly twitchy tool:

Comments

Another very useful feature is to use autofilters to sum up data for only the visible data.

A slight gotcha there is that one has to use the SUBTOTAL function as opposed to the SUM function.

Hi Hawkse,

Good idea. However, I just tried it with SUM and it works fine; it only sums what is visible.

You bring up another point that I've been thinking of, though, which is that the AutoPilot feature combines filtering and calculations. I've done one entry for it and I think I'll be doing another.

Solveig

Operations which do NOT affect filtered out rows:
Copy
Delete contents
Delete row
Format
Find & Replace in current selection

Operations which DO affect filtered out rows:
Fill
Cut
Paste
Move

For way too much information (I hesitate to say clarification) on this extremely unintuitive behaviour, see:
http://www.openoffice.org/issues/show_bug.cgi?id=33851
http://wiki.services.openoffice.org/wiki/Calc/Drafts/Issue_33851
http://wiki.services.openoffice.org/wiki/Talk:Calc/Drafts/Issue_33851

Huw,

Thank you! It looks pretty inconsistent, doesn't it? Or as you say, not intuitive.

Thanks for the info, this will be very useful.

Solveig

Post a comment