Excel: Data Extract with Wildcards on Nontext ItemsLast reviewed: November 30, 1994Article ID: Q41624 |
The information in this article applies to:
SUMMARYMicrosoft Excel supports the use of wildcards such as "*" and "?" in a database criteria only when searching a column of text. A column of values will not extract properly with wildcards in the criteria. Once you use a wildcard in a criteria, the criteria is treated as text; comparing a text criteria to a value will never be equal.
MORE INFORMATIONThe following is an example of a method to simulate the use of wildcards to search a column of values:
A1: Name B1: Zip A2: Joe B2: 98121 A3: Jim B3: 98345 A4: Mary B4: 98223 A5: John B5: 12345When extracting all of the people that had names that started with "J", the criteria would look like the following:
D1: Name D2: J*Choosing Extract from the Data menu would then extract a list that looks like the following:
Name Joe Jim JohnTo do the same thing with the zip code, such as extract every zip code that starts with "98", the criteria would be:
D1: D2: =LEFT(TEXT(B2,"##"),2)="98"Note the blank cell, D1. Using a blank as the column title for the criteria tells Excel that you are using a computed criteria. Using the above criteria and then choosing Extract from the Data menu would extract a list that looks like the following:
Zip 98121 98345 98223In Microsoft Excel version 5.0, you can filter your data more easily than performing an extract. To filter your information, choose Filter from the Data menu, then choose Advanced Filter and enter the criteria.
REFERENCES"Microsoft Excel User's Guide," version 3.0, page 374 "Microsoft Excel Reference," version 2.x, page 180
|
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |