Excel Custom Validation when with Like Function

Viewed 42

I am trying to enforce some excel validation using like function. IF A1 is not like "YES" then Do not allow the user to enter anything in Cell B1. Any help is appreciated. Thanks!

1 Answers

For case sensitive:

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

For non case sensitive:

=ISNUMBER(SEARCH("YES",A1))

Both will return a number if the word is found and an error if not. The ISNUMBER will return FALSE if error and TRUE if number.

Related