# How can I get the datedif function to work in Calc? It throws #NAME? error now [closed]

Trying to answer the question https://ask.libreoffice.org/nl/questi... on the Dutch section here got me stuck with a weird problem: while datedif is listed in the online Help with full description of its syntaxis, it doesn't appear in the function assistant and it consistently throws a #NAME? error. Do I need to toggle some MS support setting in the install procedure or is this something hidden in the options? Happens on LO version 6.0.1.1 (x64) and 6.0.3.2.

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by floris v close date 2018-05-19 22:08:07.907330

IF a function doesn't appear in the function assistant then it is either a user function or a function of another version. Help is a separate file so may contain inconsistencies depending on the installation process (example: may a newer help installed or an older help not uninstalled)

( 2018-05-20 08:48:56 +0100 )edit

Sort by » oldest newest most voted

Solved after installing version 6.0.4.2 (x64) Build ID: 9b0d9b32d5dcda91d2f1a96dc04c645c450872bf - no modifications were needed.

more

Please check DATEDIF syntax - https://help.libreoffice.org/Calc/DAT...

It throws #NAME? error if Interval parameter is missing. Interval is a string, accepted values are "d", "m", "y", "ym", "md" or "yd".

more

I checked all of those before I posted this, read the specs three times over, how much can one do? ;=)

( 2018-05-19 16:35:42 +0100 )edit

Just installed clean version of LO 6.0.3.2 on x86 Windows 7 machine without changing any defaults - DATEDIF is in the formula list. Screenshot added to answer. I can get #NAME? error when passing plain text as Date argument or when using Interval argument without double quotes. In your case seems formula itself is missing (or maybe have other local name?)

( 2018-05-19 21:01:05 +0100 )edit

As usual the help isn't very useful as it doesn't make clear what is accepted as a 'Start date' or an 'End date'. Dates are by default integer numbers in Clac (option relevant). In this case also dates in a textual representation are allowed as my examples showed. However, the choice of acceptable formats will heavily depend on language options and (probably) on the language (locale) setting under 'Numbers' in Format Cell...'. It's this lack of clarity I call the function a monster for.

( 2018-05-19 21:14:14 +0100 )edit

Functions the working of which cannot be precisely explained in a concise way in a help text should be deprecated. That would apply to next to all, I am afraid, on the other hand. There were some decades now efficiently used to mess up things, and something like the third parameter of DATEDIF() does the rest.
My advice: Do not use this crazy function. Stick to the few we know for how to tell if something is a bug.

( 2018-05-19 21:19:14 +0100 )edit

For me the function is listed in the wizard and it works in V5.4.4 and in V6.0.3 as well.
Well, I regard this function as a monster nobody should use, and therefor I did never study ift the results it returns comply with its specification. Anyway I don't get an error message from (e.g.)

=DATEDIF(TODAY();TODAY()+11;"d")
=DATEDIF(DATEVALUE("2018-05-19");DATEVALUE("2018-05-30");"d")
=DATEDIF("2018-05-19";"2018-05-30";"d")


and the result of 11 returned in each of these cases is plausible.

more