?
Solved

SharePoint calculated column error

Posted on 2013-06-17
1
Medium Priority
?
461 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
[X]
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
1 Comment
 
LVL 5

Accepted Solution

by:
manojce earned 1400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

801 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