Registrations are now open. Join us today! There is still a lot of work to do on the wiki yet! More information about editing can be found here. Already have an account?

# Microsoft KB Archive/24666

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

# Excel: Creating Criteria to Find Numbers or Text in Field

Last reviewed: October 31, 1994
Article ID: Q24666

## SUMMARY

To extract records from a Microsoft Excel for the Macintosh version 1.0. 1.03, 1.04, 1.06, 1.5, 2.2, or 3.0 database based on whether a field in the record contains a number or text, use a computed criteria with the TYPE function.

For example, to find all records that contain a number in the "CODE" field of the following database, a computed criteria has been created in E1:E2:

```   +---+-----------+----------+---+-------------+
|   |     A     |     B    | D |      E      |
+---+-----------+----------+---+-------------+
| 1 | NAME      | CODE     |   |             |
+---+-----------+----------+---+-------------+
| 2 | Sam       |      156 |   | =TYPE(B2)=1 |
+---+-----------+----------+---+-------------+
| 3 | Nancy     |   34a-12 |   |             |
+---+-----------+----------+---+-------------+
| 4 | Fred      |    10021 |   |             |
+---+-----------+----------+---+-------------+
| 5 | Carol     |    7b-15 |   |             |
+---+-----------+----------+---+-------------+
```

To find all records that contain a text string in the "CODE" field of the database, you must enter the formula =TYPE(B2)=2 in cell E2 of the computed criteria. To define the criteria range, select cells E1:E2 and choose Set Criteria from the Data menu.