Ask Your Question
0

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

asked 2018-05-19 14:16:18 +0200

floris v gravatar image

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 flag offensive 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

Comments

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)

Xoristzatziki gravatar imageXoristzatziki ( 2018-05-20 08:48:56 +0200 )edit

3 Answers

Sort by » oldest newest most voted
0

answered 2018-05-19 22:07:30 +0200

floris v gravatar image

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

edit flag offensive delete link more
1

answered 2018-05-19 15:31:20 +0200

updated 2018-05-19 21:01:41 +0200

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".

image description

edit flag offensive delete link more

Comments

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

floris v gravatar imagefloris v ( 2018-05-19 16:35:42 +0200 )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?)

SM_Riga gravatar imageSM_Riga ( 2018-05-19 21:01:05 +0200 )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.

Lupp gravatar imageLupp ( 2018-05-19 21:14:14 +0200 )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.

Lupp gravatar imageLupp ( 2018-05-19 21:19:14 +0200 )edit
0

answered 2018-05-19 15:31:29 +0200

Lupp gravatar image

updated 2018-05-19 15:34:46 +0200

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.

edit flag offensive delete link more

Comments

Seea also the specification of the type DateParam and probably the specification of respective conversion reqirements.

Lupp gravatar imageLupp ( 2018-05-19 15:38:23 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2018-05-19 14:16:18 +0200

Seen: 856 times

Last updated: May 19 '18