SharePoint 2013/2016/Online List Column Validation Examples

This SharePoint tutorial contains a few SharePoint 2013 list column validation examples. After reading this tutorial, you will get to know how to implement list column validations in SharePoint Online or SharePoint 2013/2016.

Here I have explained, 5 SharePoint list column validation examples.

SharePoint list column validation example-1

We will see a few examples of how column validation works for a particular item in the SharePoint List.

Here my requirement is I have a SharePoint 2013 list which contains a Title column, I want user should be able to put only “Mr” or “Mrs”. If users put something else other than this, then it should give an error message saying You can put only Mr or Mrs.

To use validation for a particular column, follow the below steps:

Open your SharePoint List, then go to List Settings. In the Settings page, go to the Columns section and then click on the particular column for which you want to use the validation. In my case, it is the Title Column.

SharePoint 2013 List Column Validation Examples
SharePoint 2013 List Column Validation Examples

This will open the Edit Column page, here click on “Column Validation”. The in the Formula box put like below:

=OR(Title=”Mr”,Title=”Mrs”)

And in the User message, put the message which the user wants to see if the validation fails like: “Please only put Mr or Mrs”. The formula should look like below:

SharePoint 2013 List Column Validation Examples
SharePoint 2013 List Column Validation Examples

Then click on OK and Save the formula. Now try to add one item to the list. If you put any other thing apart from “Mr” or “Mrs” in the Title column, it should display the message like below:

SharePoint 2016 List Column Validation Examples
SharePoint 2016 List Column Validation Examples

SharePoint list column validation example-2

Similarly, If you want to validate another column, let’s say you have an age column and you want to show a validation message if the user put value less than 25.

You can write in the Column validation formula like below:

=(Age>25)

It should look like this:

SharePoint online List Column Validation Examples
SharePoint online List Column Validation Examples

Now when user try to put value less than 25, it will show a message like below:

SharePoint 2013 List Column Validation Examples
SharePoint 2013 List Column Validation Examples

SharePoint list column validation example-3 (First name and Last name should not be same)

Now we will see in another example, how to use SharePoint 2013 List validation settings. Here I have a SharePoint 2013 list which has two columns First Name and Last Name. My requirement here is if First Name and Last Name should not be the same, If the user enters the same value then it will display a validation message and data should not save to the list.

To use the List validation, Open your SharePoint 2013 list, then go to List Settings from the Ribbon. Then from the General Settings click on “Validation settings”.

Then in the Validation Settings page, In the formula box put:

=FirstName<>LastName

And in the User Message box, you can put the message which you want to display to the user when validation fails. It should look like below:

List column validation in SharePoint 2013
List column validation in SharePoint 2013

Now when you try to add an item and if you put first name and last name same, then it will display a message like below:

List column validation in SharePoint 2016
List column validation in SharePoint 2016

This way you can validate that, first name and last name can not be same.

SharePoint list column validation example-4 (Date should not be less than today)

Similarly, Suppose you have a Date type column and you want user should always select a date less than today, then you can write the formula as:

=DateOfJoining<Today()

Now if the user selects a date greater than today then it will display a message like below:

List column validation in SharePoint online
List column validation in SharePoint online

SharePoint list column validation example-5 (Length Should not be greater than N characters)

Similarly, if you want to validate the Title field length, then you can put the formula like below:

=LEN(Title)<25

And you can display a message like below:

The title should not be more than 25 characters. After this if the user tries to put title length more than 25 characters then it will display the message like below:

SharePoint 2013 List Column Validation Examples
SharePoint 2013 List Column Validation Examples

You may like following SharePoint list and library tutorials:

Hope this SharePoint tutorial helps to learn how to implement list column validation in SharePoint 2013/2016 or SharePoint Online.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>