SharePoint column validation examples for Capital Letters

SharePoint column validation examples for Capital Letters
3 votes, 5.00 avg. rating (97% score)

Introduction

In this post we will cover few more SharePoint column validation examples implementing Capital Letters scenario with their formulas.
You can check my earlier post http://adicodes.com/capital-letter-validation-in-sharepoint/ with detailed example for capital letter validation

1. SharePoint validation – first two letters should be capital letters

Considering column ‘FirstName’ as single line of text type

Formula

=AND(
CODE(UPPER(MID(FirstName,1,1)))=CODE(MID(FirstName,1,1)),
CODE(UPPER(MID(FirstName,2,1)))=CODE(MID(FirstName,2,1))
)

This formula will enforce first two letters of ‘FirstName’ column should be in capital letters
If I give ADiseshu as input it will allow, but if I give the value as Adiseshu it will not allow

2. SharePoint validation – all letters should be in capital letters

Considering column ‘LastName’ as single line of text type and ‘LastName’ length as 5 letters.
For each digit we are adding code line to check. If we have more digits, then add for them also.


Formula

=AND(
CODE(UPPER(MID(LastName,1,1)))=CODE(MID(LastName,1,1)),
CODE(UPPER(MID(LastName,2,1)))=CODE(MID(LastName,2,1)),
CODE(UPPER(MID(LastName,3,1)))=CODE(MID(LastName,3,1)),
CODE(UPPER(MID(LastName,4,1)))=CODE(MID(LastName,4,1)),
CODE(UPPER(MID(LastName,5,1)))=CODE(MID(LastName,5,1))
)

This formula will enforce ‘LastName’ value should be in capital letters.
If I give DASARI as input it will allow, but if I give the value as Dasari it will not allow

Note that, these are column level validations as formula involves with column itself not with another column. So, validation rule should be provided at
List Settings > select column under columns > Add formula under Column Validation

You can refer list of ASCII codes here http://www.asciitable.com/

Conclusion

Hope this helps you in implementing SharePoint column validation for enforcing rules regarding capital letters.

December 11, 2013 В· Adi В· One Comment
Posted in: Sharepoint 2010, SharePoint 2013, Validations

One Response

  1. rav - July 28, 2015

    I need to validate name column so that it can only take alphabet.

Leave a Reply

What is 2 + 9 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)