Posts Tagged ‘Formula’

SharePoint Calculated columns – Adding hours onto a date field

Date:May 18th, 2010 Author: Tags: , , ,
Category: General, SharePoint Ideas Comments:10 ;

A customer recently contacted me with an interesting question.

They were using a SharePoint task list to help schedule jobs for field engineers but rather than have a Start Date and End Date field they wanted to have a Start Date and Duration field and automatically work out the End Date.

So End Date = Start Date + Duration

They were then planning to display this using Planner in the By Category view which is idea for resource booking as it makes it easy to see when a resource is booked or free (SharePoints built in gantt chart can’t do this swimlane style of view and doesn’t support using calculated columns).

Now this is easy to do if the Duration is specified in days – in fact you just use the equation above – but what if Duration is in hours or minutes?

First port of call is this page from Microsoft showing examples of common date time formula you can use in SharePoint calculated columns hmmm, adding days OK… adding months Check… adding years OK too….but nothing about hours. Back to the drawing board.

(more…)

Tip – Showing multiple columns in SharePoint Planner Webpart

Date:October 14th, 2009 Author: Tags: , , , , , ,
Category: Calculated Columns, SharePoint Planner, SharePoint webparts Comments:1 ;

There may be times when you want to display timeline or category information from more than one list column in a gantt chart. For example in the chart below we have taken information from the “priority” and “title” columns of a list to populate the category labels.

With Planner you can show multiple columns in the Category or on the Timeline of a Gantt chart by using a calculated column to merge fields together.

concat-columns
For example to merge Priority and Title columns together you would :-


  • From your list click Settings > Create Column
  • Set a name such as “Category”
  • Choose Calculated for the type
  • In formula enter (where [Title] etc is the name of the columns you want to merge)
      =[Priority] & " : " & [Title]
  • Uncheck ‘Add to default view’ checkbox if you don’t want this appearing for the normal list view.
  • In Planner you can now select this column.

You can merge multiple columns together, for example :-

   =[Priority] & " : " & [Title] & " - " & [Assigned To]

You can also use SharePoint standard functions and formula (many similar to excel) such as :-

   =Text([Start Time],"mmm-yyyy") " : " & [Title]

Which would prefix the Title with Month and year, like so  October-2009 : Your title here

To display the the duration in days you could use

   =DATEDIF([Start Time],[End Time],"d") & " Days"

See some more examples of common functions

The … ehem… Truth about using [Today] in SharePoint Filters

Date:November 25th, 2008 Author: Tags: , ,
Category: Calculated Columns, Filter, SharePoint Ideas Comments:12 ;

Back in the day of Windows SharePoint Server 2 and SharePoint Server 2003 you couldn’t use [Today] in Filters.

For example if you tried to setup a filter like this to show items added in the last 7 days


"Filter value is not in a supported date format"

Created is greater than [Today] - 7

Created is greater than [Today] – 7

You would receive an error “Filter Value is not a valid date” when clicking OK

(more…)

Advanced SharePoint View and Filter techniques

Date:October 26th, 2008 Author: Tags: , , ,
Category: Filter, SharePoint Ideas Comments:119 ;

Introduction

We discussed in a previous article how to customise SharePoint’s built in Task List and briefly looked at the power of Views with Filters. In this article we will build upon that by demonstrating some advanced use of Filters.

This article assumes that you are already familiar with Views and Filters – if not please review the previous article.

(more…)