Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Move chart to a separate worksheet in Excel
  • Example of COUNTIFS with variable table column in Excel
  • Understanding Anova in Excel
  • How to Sort by Color in Excel
  • Excel Pie Chart

References

  • Merge tables with VLOOKUP in Excel
  • Two-way lookup with VLOOKUP in Excel
  • Complete List of Excel Lookup and Reference Functions, References and Examples
  • How to use Excel VLOOKUP Function
  • How to use Excel MATCH Function

Data Validations

  • Excel Data validation date in next 30 days
  • Excel Data validation must contain specific text
  • Excel Data validation allow uppercase only
  • Excel Data validation number multiple 100
  • Excel Data validation specific characters only

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:   How to get sheet name only in Excel

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:   Sum if one criteria multiple columns 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 get first word 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:

VLOOKUP without #N/A error in Excel

Next Post:

How to Create Gantt Chart in Excel

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

Logical Functions

  • Not Equal To ‘<>‘ operator in Excel
  • Complete List of Excel Logical Functions, References and Examples
  • Excel If, Nested If, And/Or Criteria Examples
  • How to use Excel TRUE Function
  • XOR function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Calculate retirement date in Excel
  • Extract date from a date and time in Excel
  • How to calculate Next working/business day in Excel
  • Get last day of month in Excel
  • How to join date and text together in Excel

Grouping

  • Map inputs to arbitrary values in Excel
  • How to randomly assign data to groups in Excel
  • Group times into 3 hour buckets in Excel
  • Group arbitrary text values in Excel
  • Calculate conditional mode with criteria in Excel

General

  • How to calculate percentage discount in Excel
  • How to get original price from percentage discount in Excel
  • How to count total columns in range in Excel
  • How to create dynamic worksheet reference in Excel
  • Convert column number to letter in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning