# Data validation must contain specific text

Data validation rules are triggered when a user adds or changes a cell value.

In this formula, the FIND function is configured to search for the text "XST" in cell C5. If found, FIND will return a numeric position (i.e. 2, 4, 5, etc.) to represent the starting point of the text in the cell. If the text is not found, FIND will return an error. For example, for cell C5, FIND will return 5, since "XST" starts at character 5.

The result returned by the FIND function is then evaluated by the ISNUMBER function. For any numeric result returned by FIND, ISNUMBER will return TRUE and validation will succeed. When text isn't found, FIND will return an error, ISNUMBER will return FALSE, and the input will fail validation.

### Must not contain

To validate input only when a cell does not contain specific text, you can replace the ISNUMBER function with ISERROR like this:

This formula will return TRUE when "XST" is *not found*, and data validation will succeed.

*Note: Cell references in data validation formulas are relative to the upper left cell in the range selected when the validation rule is defined, in this case C5.*

## Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.

## Download 200+ Excel Shortcuts

Get over 200 Excel shortcuts for Windows and Mac in one handy PDF.