In addition you should note that the "international default" separator for function parameters is the semicolon for OpenOffice successors. LibreOffice some time ago introduced the comma to the role in locales defaulting the decimal separator to the point. This aimed at "better" compatibility with a competitors spreadsheets jettisoning compatibility with LibO itself across locales. Evil idea. However, they also introduced a setting for Calc under 'Formula'>'Separators'>'Function:' where informed users can

and should enter the semicolon. LibO also still accepts the semicolon for input of formulas under any locale. If you want to continue to take part in the international ("en") community, please also do so. Otherwise you may consider to shift to an Excel forum.

Your generalized formula should thus read:

- Code: Select all Expand viewCollapse view
`DATEDIF(StartDate; EndDate; mode)`

Concerning the 'mode' parameter "robleyd" already gave you the needed information.

Now you may test the function with the formula

- Code: Select all Expand viewCollapse view
`=DATEDIF(B1;C1;"y") & " years " & DATEDIF(B1;C1;"ym")& " months " & DATEDIF(B1;C1;"md") & " days"`

and the values

- Code: Select all Expand viewCollapse view
`2022-03-29 and 2062-01-11`

for StartDate and EndDate respectively in B1:C1. I suppose that's what many users want to get.

Please note that the result NOT is a way to express actual durations. Due to the purely calendaric meaning of dates you cannot calculate a number of days (14533 for the given example) from the split result. Simply use

- Code: Select all Expand viewCollapse view
`=EndDate - StartDate`

for a duration in days.

On Windows 10: LibreOffice 7.0 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2

---

Lupp from München