In a particular cell in excel, I have to put validation so a user can not input text values with special charter like "-"
, ","
, "|"
, "/"
, ... in between except "_"
(underscore).
I have written a custom formula for this and it is working but it has a limitation, isn't resolve my problem completely.
Here is a formula:
=ISNUMBER(FIND("_",A1))
so when a user enters text with some other character like ","
or "-"
in between text values, it will throw a validation error.
But if a user enters only text without any special character then it also throws an error and user not able to enter text.
if the user enters only text then it allows the text but if the user enters text with special character then it allows only "_"
special character.
example:
- allowed:
"StackOverflow"
,"Stack_Overflow"
- not allowed:
"Stack-Overflow"
,"Stack, Overflow"
or any other special character.