Solved

SharePoint calculated column error

Posted on 2013-06-17
1
452 Views
Last Modified: 2013-06-26
I have the following formula to calculate day difference between two dates:
=IF(OR(LEN(Date1)=0,LEN(Date2)=0)," ",DATEDIF(Date1,Date2,"d"))

Open in new window

It works great but with one exception. In a very rare situation Date2 can be greater than Date1 and the result will be negative. In this case SharePoint will display an ugly #NUM! error code.

Can you please modify the above to show 0 (zero) instead of the error code if the Date2 is greater than Date1? Thanks!
0
Comment
Question by:MisUszatek
1 Comment
 
LVL 5

Accepted Solution

by:
manojce earned 350 total points
ID: 39255341
Hi,

=IF(OR(LEN(Date1)=0,LEN(Date2)=0)," ",IF(Day(Date1)>Day(Date2),"0",DATEDIF(Date1,Date2,"d")))

Open in new window



Its working in my site.

Thanks,
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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 (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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