Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Calculated date / days Error

Posted on 2011-05-09
Medium Priority
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
  • 3
LVL 14

Accepted Solution

abhitrig earned 2000 total points
ID: 35722112
=IF([Start]>[TODAY],0,DATEDIF([Start], [Today],"d"))

Author Comment

ID: 35722217
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

ID: 35726511
Brilliant, thank you very much

Expert Comment

ID: 36485190
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

ID: 36485888

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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

581 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