1

I created a calculated column and enter this formula:

=DATEDIF([Column 1],[Column 2],"d")

I picked the columns from the list to the right of the formula block. When I entered this, it gave an error that the syntax wasn't correct. Also when I went to the column, it showed #Name as the value.

Also, I have it selected as a number column as output. One last thing, when I click ok and go back to the formula, it removes the bracket from one of the columns, i.e. =DATEDIF(Column 1,[Column 2],"d").

Not sure what I am doing wrong. This is for SharePoint 2013.

  • Also, I have it selected as a number column as output. One last thing, when I click ok and go back to the formula, it removes the bracket from one of the columns, i.e. =DATEDIF(Column 1,[Column 2],"d"). – P BRT Feb 25 '18 at 6:42
2

Try to make sure the following:

  • Make sure that the two fields are DateTime fields.
  • Make sure that the Column1 is less than or equal to Column2 otherwise, you will get #NUM! or #NAME! based on the datatype of the field.

Example:

Consider your formula like this

=DATEDIF([Start Date],[Due Date],"d")

So to get it worked without any issue, you should make sure that the first column in the formula (in this case, [Start Date]) is less than or equal to the second column (in this case, [Due Date])

So as shown below the blue highlighted is true because the [Start Date] is less than [Due Date]

enter image description here

  • Yes, both data fields are date/time fields and I have Submitted date is less than or equal to Request Completed. – P BRT Feb 25 '18 at 19:27
  • do you still face the issue? – Mohamed El-Qassas MVP Feb 25 '18 at 19:28
  • I get #Value in the cell now. – P BRT Feb 25 '18 at 19:29
  • share with me your current formula – Mohamed El-Qassas MVP Feb 25 '18 at 19:30
  • =DATEDIF([SUBMITTEDDATE],[REQUESTCOMPLETED],"d") – P BRT Feb 25 '18 at 19:33
0

I have done a test in my SharePoint 2013 and i cannot reproduce your issue.

I created calculated column like the following:

enter image description here

Then it displays the correct number:

enter image description here

For your issue, please offer screenshots about your calculated column and your list to further troubleshoot the issue.

Besides, try to create an new list, create calculated column in the new list and compare the results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.