Validate text entered in field

Hi guys,
Is it possible validate the text written in a field?

The conditions for the text are as follows:
1 = It must have at least 5 letters.
2 = The first letter must be uppercase and the rest lowercase.
3 = It must not have spaces.

I have tried this formula and many others, but I can't get it to work.
AND(
LEN([_this]) >= 5,
UPPER(LEFT([_this], 1)) = LEFT([_this], 1),
LOWER(RIGHT([_this], LEN([_this]) - 1)) = MID([_this], 2, LEN([_this]) - 1)
)

Solved Solved
0 5 355
1 ACCEPTED SOLUTION

Steve
Platinum 5
Platinum 5

The = operator is case-insensitive, meaning upper- and lower-case letters are seen as the same, so you can't use it to test whether a letter's case is suitable. The only way to do case-sensitive comparisons is to use FIND().

AND(
  (LEN([_THIS]) >= 5),
  (FIND([_THIS], (UPPER(LEFT([_THIS], 1)) & LOWER(RIGHT([_THIS], LEN([_THIS]) - 1)))) = 1)
)

Untested.

 

 

View solution in original post

5 REPLIES 5
Top Labels in this Space