Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • How to get relative row numbers in a range in Excel
  • How to calculate two-way lookup VLOOKUP in Excel Table
  • Merge tables with VLOOKUP in Excel
  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • Convert text string to valid reference in Excel using Indirect function

Data Analysis Examples

  • Error Bars in Excel
  • Calculate Conditional Percentile ‘IF’ in table in Excel
  • Number and Text Filters Examples in Excel
  • Conflicting Multiple Conditional Formatting Rules in Excel
  • How to perform a t-Test in Excel

Data Validation Examples

  • Excel Data validation exists in list
  • Excel Data validation only dates between
  • Excel Data validation require unique number
  • Excel Data validation specific characters only
  • Excel Data validation with conditional list

Excel Data validation must contain specific text

by

How to set criteria in Excel to accept specific text.

To allow only values that contain a specific text string, you can use data validation with a custom formula based on the FIND and ISNUMBER functions.

Formula

=ISNUMBER(FIND("txt",A1))

Explanation

In the example shown, the data validation applied to C5:C9 is:

=ISNUMBER(FIND("XST",C5))

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

Worked Example:   Excel Data validation must not contain

How this formula works

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.

Worked Example:   Count rows that contain specific values in Excel

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:

=ISERROR(FIND("XST",C5))

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

Worked Example:   How to extract name from email address in Excel

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.

Post navigation

Previous Post:

Excel Data validation with conditional list

Next Post:

Excel Data validation must not contain

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • EXACT function: Description, Usage, Syntax, Examples and Explanation
  • How to count specific words in a range in Excel
  • Remove text by variable position in a cell in Excel
  • RIGHT, RIGHTB functions: Description, Usage, Syntax, Examples and Explanation
  • PHONETIC function: Description, Usage, Syntax, Examples and Explanation
  • Get project end date in Excel
  • Display the current date and time in Excel
  • EDATE function: Description, Usage, Syntax, Examples and Explanation
  • Get days between dates ignoring years in Excel
  • Add days exclude certain days of week in Excel
  • How to calculate compound interest in Excel
  • DDB function: Description, Usage, Syntax, Examples and Explanation
  • Calculate cumulative loan principal payments in Excel
  • How to calculate annuity for interest rate in excel
  • SLN function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2021 xlsoffice. All Rights Reserved | Teal Smiles