SharePoint Calculated Columns are one of the great OOTB feature to manipulate other columns in the list and produce an output based on the formula we provide. To look into the usage of formulas from MSDN, please click here
Here in this article we look into the approach how to create a calculated column which will hold the current date.
If we straight away go ahead and create the calculated column by applying the formula as [Today], like shown below.
Then we will end up with an error saying ‘Calculated columns cannot contain volatile functions like Today and Me.‘
To overcome this error and to get the current date in our calculate column. There is a workaround for this, Please follow the below step by step approach.
Step 1: Create a Column with the name ‘Today’.
Open the ‘List Settings’ page and click on ‘Create Column’.
In the Column name text box, give the name as Today and let the type of the column is Single line of text.
Step 2: Create a Calculated Column and refer the Column which is created in Step 1.
Now, the Calculate column in which we want the current date needs to be created. Go to List settings -> Create Column. And give the name for the column and select Calculated in type of the column
In the formula section, just insert the column ‘Today’ which we created in Step 1 and select the data type returned from this formula is: Date and Time click OK.
Step 3: Delete the ‘Today’ column which was created in Step 1.
At last, just delete the column which was created in Step 1, named as Today.
Now you can see the current date in the Calculate column.
Please note that this calculate column will show the Current Date only if the item is edited otherwise it will show the last updated date, the Calculated col value won’t be updated automatically.
Happy Coding
Ahamed Buhari
Leave a comment