SharePoint List Validation Example: Announcement Expiry Date Should be greater than or equal to Created Date

This SharePoint tutorial explains, an example of list validation in SharePoint 2013/2016/Online. We will see how to validate the expiry date should be greater than or equal to the created date in SharePoint.

Here I have an out of box Announcement list. In the announcement list, there is a Title, Body and Expires column. The Expires column is a date and time column which indicates the expiry date of the announcement. Here we will validate that the Expiry date should be greater than today. User should not add an announcement which is already expired.

SharePoint 2016/2013 provides out of box validation settings at the list level as well as in the column level.

The difference between the two methods is that using the column properties does not provide the ability to compare two columns in the same list, whereas the List Settings validation option allows us to validate using two columns. The column properties validation settings are useful when comparing a column value with a static value.

You can create an Announcement App using Announcement template in SharePoint. Then open the list and then from ribbon go to the LIST tab and click on the List Settings button. This will open the list settings page.

In the List Settings Page, click on Validation settings which are presented under General Settings.

In the Validation Settings page, in the Formula, it will display columns to insert into your formula. Write your formula like below:

Formula: =[Expires]>=[Today]
User Message: Insert Future Announcements, this one already expired.

The formula looks like below:

sharepoint list validation example

Now try to add one announcement and choose the expiry date as less than today. You can see a validation message like below and it will now allow you to add the announcement.

sharepoint 2016 list validation example

But if you will add an announcement whose expiry date is greater than today it will allow to add.

sharepoint list validation example expiry date should be greater than or equal to created date

You may like following SharePoint 2016 tutorials:

This SharePoint tutorial we learned how to validate expiry date should be greater than or equal to created date in SharePoint 2013/2016/Online.