Im working with a calculated field and using a formula to retrieve the difference of the days between two dates, DATE1 and DATE2, my simple formula is:
=DATEDIF([DATE1], [DATE2],"d")
It works fine when DATE1 and DATE2 have value, but when DATE1 or DATE2 has no values I got the #NÚM!
Error.
I searched about how to deal with errors in formulas on MSDN and find this useful topic: https://msdn.microsoft.com/en-us/library/office/bb862071(v=office.14).aspx
So I make this formula:
=ISERROR(DATEDIF([DATE1] , [DATE2] ,"d"), "0", DATEDIF([DATE1] , [DATE2] ,"d"))
If the date difference between DATE1 and DATE2 brings me an error, I set the value of field to 0. If the difference brings me a number I set the value of the field with this number. But when I try to save this formula in the column, Sharepoint brings me te error "Could not save changes to the server" because he can't compile the formula.
I have 6 different fields in the list where I have to use DATEDIF function to return the difference of the days and a column to make the SUM of all date differences, when I get the #NÚM error I can't make this SUM.
What I'm doing wrong? Thanks in advance