XL: Unexpected Results When Filtering Text StringsLast reviewed: February 2, 1998Article ID: Q134941 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, when you extract data from a list, you may receive unexpected results if your list contains numbers that are entered as text strings (by preceding the number with an apostrophe). Numbers that are formatted as text strings and contain leading zeros may be extracted--this may not be the result you desire. For example, if your criteria is '012, the numbers '12, '012, 12, and '0012 all meet the criteria.
CAUSEIf the criteria is entered as a text string and not as part of the computed criteria, Microsoft Excel extracts all records that contain the text string at the beginning of the record even if that record is a numeric value.
RESOLUTIONTo filter records in a list when the list contains an exact match to a numeric value entered as a text string, use computed criteria. For example, if you are working with data that resembles the following
A1: Number B1: C1: Number A2: '12 B2: C2: '012 A3: '012 B3: C3: A4: 12 B4: C4: A5: '0012 B5: C5:type the following information into cells C1:C2 of the Criteria Range in the example above:
C1: ExactNumber C2: =A2="012"NOTE: The criteria name in the first row of the criteria range (cell C1) can be any name except the name of a database field; if you use the name of a database field, Microsoft Excel interprets the criteria as comparison criteria. You can also leave the cell blank.
REFERENCESFor more information about computed criteria, click the Search button in Help, and type:
computed criteriaChoose the Show Topics button, select the topic, and choose Go To.
|
Additional query words: 5.00 5.00a 5.00c 7.00 8.00 97 XL97 98 XL98 filter
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |