Support Portal Language
 
HomeKnowledge BaseDHQAdminHow To: Calculated Columns
Information
Article ID49
Created On7/15/2010
Modified7/20/2010
How To: Calculated Columns
Within your lists in DHQ, you can create calculated columns to perform certain tasks automatically like taking hours and multiply them by the rate to obtain a total, or determine a date span between dates.

You will require the necessary permissions to complete these steps. If you do not have the correct permissions, contact your DHQ Administrator for further assistance.

Microsoft has released a great reference for formulas for the calculation field. See http://office.microsoft.com/en-us/windows-sharepoint-services-help/examples-of-common-formulas-HA010105479.aspx for more details on what you can do within a calculated field.

Current Date Issue
Working with the current date is tricky in calculated columns. The columns do not support [Today]. If you were to add it you will get the error: Calculated columns cannot contain volatile functions like Today and Me. There is a way around this. In the following example, we want to know the duration in days an item has been open. If the item isn't closed yet then we want to use the current date.

  1. Browse to the list and click Settings then List Settings.
  2. Create a new field called Today with a column type of Date & Time.

 3. Create a calculated field and paste in the following

=IF([End Date] = "",DATEDIF([Start Date],[Today],"d"),DATEDIF([Start Date],[End Date],"d"))

  1. Change End Date to the name of your closed date column and change Start Date to the open date colum.
  2. Click OK.
  3. Click on the Today field and delete this field.

Your column will now work with the calculated fields properly. If you need to tweak the calculated field again, you'll need to add the Today column, make your modifications, then delete it.

For further assistance, please submit a ticket to DHQ support.