Calculated date / days Error

Posted on 2011-05-09
Last Modified: 2012-08-13
Dear Experts

I have a Sharepoint 2010 list which does a number of calculations, once of which calculates the number of days a project has been running - I do this by using a calculated column with the following formula:

=DATEDIF([Start], [Today],"d")

this works beautifully if the [Start] date is in the past.  What I need to be able to do put in an error trap that applies to when the [Start] is in the future - this should return a value of 0 (zero).

Can anybody help?
Question by:correlate
    LVL 14

    Accepted Solution

    =IF([Start]>[TODAY],0,DATEDIF([Start], [Today],"d"))

    Author Comment

    Thanks for this, looks promising. I won't be able to test it out until later tonight / early tomorrow but will let you know how I get on

    Many thanks

    Author Closing Comment

    Brilliant, thank you very much

    Expert Comment

    Sorry to jump in, but I have a requirement to check how long since a project was closed, trying to use a Calculated Column to calculated ([today] - [Date Closed]), but SP complains that you can't use volatile functions like [today] in calculated columns.  How are you managing it?

    Author Comment


    There is a way, I've used (courtesy EE I think), I'll need to dig it up, but if I recall it involves something along the lines of creating a field called [today] and then deleting it. I am no Sharepoint guru, but if I can post where I found the answer I will certainly do so in the morning

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
    Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video discusses moving either the default database or any database to a new volume.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now