Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Extracting Targeted Records from a List.

Extracting Targeted Records from a List

Written by Allen Wyatt (last updated December 2, 2023)
This tip applies to Excel 97, 2000, 2002, and 2003


1

In a business environment, it is not unusual to use Excel to help manage the data you need to work with every day. For instance, you may use Excel to "crunch" invoice data, shipping records, or any number of different types of data. When working with that data, you may need to extract different records based upon particular criteria.

This is where the filtering capabilities of Excel come in handy. Consider the scenario where you have several thousand orders, covering customers across the country. You may want to extract the orders that belong to customers in targeted states, so that you can process them first. You can do this using the advanced filtering capabilities of Excel. (For these steps, assume that the data you want to filter is in columns A through K.)

  1. Make sure that every column in your data list has a label that describes what is in that column. For instance, the column containing each customer's state could have "State" as a label.
  2. In cell N1, enter the word "State". You are setting up a criteria table in this column, and this label informs Excel which column you want to use in matching criteria. Make this cell bold, and underline it, if desired.
  3. Starting in cell N2, enter the states you want to extract from the main data list. Enter one state per cell in the column.
  4. Select a cell somewhere within columns A through K, in your main data.
  5. Choose Filter from the Data menu, then choose Advanced Filter. Excel displays the Advanced Filter dialog box, with the address of your original data table already in the List Range box. (See Figure 1.)
  6. Figure 1. The Advanced Filter dialog box.

  7. Make sure the Copy to Another Location option is selected.
  8. Place the insertion pointer in the Criteria Range box, then select (on the worksheet) the range of cells in column N that comprise the list of states. Make sure you include cell N1, which is the label.
  9. Place the insertion pointer in the Copy To box, then select a cell where you want the records extracted to. You can select a cell on the same worksheet or on a different worksheet.
  10. If you want to leave out any duplicate records, make sure the Unique Records Only check box is selected.
  11. Click on OK.

That's it—Excel copies those records that have one of your target states to whatever location you specified in step 8, and the original data is left unchanged.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2941) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Extracting Targeted Records from a List.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Ignoring the Spelling of Proper Nouns

Proper nouns (such as the names of people) are routinely marked as incorrect by Word's spell checker. If you are tired of ...

Discover More

Opening a Template

If you have a template stored on disk, you can open it and make changes to it just as you do other documents. This tip ...

Discover More

Finding the Last-Used Cell in a Macro

Ever wonder what the macro-oriented equivalent of pressing Ctrl+End is? Here's the code and some caveats on using it.

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (menu)

Copying the Results of Filtering

Filtering is a great asset when you need to get a handle on a subset of your data. Excel even makes it easy to copy the ...

Discover More

Performing Calculations while Filtering

The advanced filtering capabilities of Excel allow you to easily perform comparisons and calculations while doing the ...

Discover More

Copying Comments when Filtering

The advanced filtering feature in Excel allows you to quickly copy unique information from one data list to another. If ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 7?

2023-12-02 08:51:57

Ron S

Other options:
- defining the data as a table, then insert a Slicer.
or
you could use powerQuery to filter data out.


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.