Sharepoint 3.0 Duration Data Calculation

Posted on 2012-09-20
Last Modified: 2012-10-15
Hi there,

I would like to, using a calculated field, work out the time taken in days between the field [Date Started] and [Date Completed].

I was using the example here:

=IF(OR(ISBLANK([Date Completed]),ISBLANK([Date Started])),0,FIXED([Date Completed]-[Date Started],0))

This will show whole days only but doesnt round up to 1 if the Start and End Date are the same day.

Is there an easy way to this with the code above. I can't say I'm over-clued on the subject.
Question by:ultra-it
    LVL 21

    Assisted Solution

    In your IF statement, add another IF that checks the value of [Date Started] and [Date Completed] and if they are the same return 1, if not proceed with the remaining piece of logic.
    LVL 44

    Accepted Solution

    this should do the trick (just the code for 66866 comment):
    =IF(OR(ISBLANK([Date Completed]),ISBLANK([Date Started])),0,IF([Date Completed]-[Date Started],FIXED([Date Completed]-[Date Started],0),1))

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (…
    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…
    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.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 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

    22 Experts available now in Live!

    Get 1:1 Help Now