Hi Tom,

I'm trying to make an excel file that will help me in a job hunt. Here's what I'm trying to automate. For sake of simplicity I'll give you a sample of three companies and three cities.

Let's say the three cities are Boston, New York and LA. The three companies are J.P. Morgan, Bank of America and Wells Fargo.

Hypothetically, let's say JPM is in Boston and New York, Bank of America is New York and LA, and Wells Fargo is in LA and Boston.

I would like to make an excel document that allows me to sort both by company and city. I might be moving on short notice to a variety of cities, and want to start narrowing down what companies are in each city before I move.

Thus - I would like to be able to highlight "Boston" and have it show me "JPM and Wells Fargo" or if I wanted to pull up where a specific company has offices, highlight "Wells Fargo" and have it show me "LA and Boston."

How would I go about doing that?


A1:  City
B1:  Company

then starting in A2

Boston       JP Morgan
Boston       Wells Fargo
New York     JP Morgan
New York     Bank of America
Los Angeles  Bank of America
Los Angeles  Wells Fargo

Now select A1 and apply the filter (in Excel 2007 or later on the home tab, select Sort & Filter in the editing command button.  In the resulting dropdown, select Filter.  This will put dropdown arrows in A1 and B1. You can select the dropdown arrow in A1 and choose your city or select the dropdown arrow in B1 and choose your company.

You remove can show all the data by going to the Sort & Filter dropdown and select clear or remove the filter in total by selecting Filter.

In excel 2003 this is found under the Data Menu, then Select Filter, then Select Autofilter.

In most cases, if you add more data, you will need to remove the filter and reapply it to pick up the new data.

if you have Excel 2007 or later, could create a table and the table has the filter capabilities and expands as you add data.  

At any time, you can do a custom sort of your data and choose what order you want it in but the filter is what allows you to narrow down the data presented.   

Tom Ogilvy  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 About.com. All rights reserved.