Wednesday, December 16, 2009

SharePoint Formulas

This is a neat hack around the problem of "Calculated columns cannot contain volatile functions like Today and Me. " when defining formulas for a calculated column.

Example:
=IF(ISERROR(INT(LEFT([Course Name],4))),YEAR(Today),INT(LEFT([Course Name],4)))

Step 1: Create a Column called Today in the List. (Data Type: Date and Time; Default Value: Today's Date)
Step 2: Define the formula in your calculated column. Today is no longer considered a volatile function because it refers to the column you have created in Step 1.
Step 3: Delete the column Today.

There you go! "Today" works perfectly in the formula now!


No comments:

Post a Comment