Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SharePoint calculated column error

Posted on 2013-06-17
1
453 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

A question that is asked often, is how to generate sequential numbers in InfoPath Forms. The best way to achieve this is to use a SQL database, along with a stored procedure and a web service to connect Forms Services to the DB. The first thing t…
There is one common problem that all we SharePoint developers share: custom solution deployment. This topic can't be covered fully in this short article, so all I want to do in this one is to review it from a development-to-operations perspectiv…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

840 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