DATEDIF Function in Collabora Office Calc: Syntax, Examples and Compatibility
Use DATEDIF in Collabora Office Calc to measure completed years or days between two dates without counting partial anniversaries as full years. Two original examples, expected results, cautions and official software documentation.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: DATEDIF counts whole days, months or years between two dates, or selected remaining components. Choose a unit explicitly and use a later end date. A calendar-year label difference is not necessarily a completed anniversary.
Availability and version history
- Introduced: original Collabora release and launch date are not established by the sources reviewed.
- Availability: documented in Collabora Office 26.04 help, scoped to the desktop-help release.
- Platform scope: online and mobile deployments are not inferred from desktop documentation.
- Checked: October 14, 2026. Direct function section and independent calendar controls; no native Collabora test was performed.
Syntax and arguments
=DATEDIF(start_date; end_date; interval)
The three arguments are required. The official 26.04 section says the end date must be later than the start. It documents interval strings "d", "m", "y", "ym", "md" and "yd", independent of the interface language. The added examples use those documented lowercase codes.
Use DATE expressions rather than unquoted slash-separated numbers, which would be arithmetic. The outputs are numeric counts, so do not apply a date display format to them.
Two original examples, with their verification scope
=DATEDIF(DATE(2020;1;1);DATE(2025;1;1);"Y")
=DATEDIF(DATE(2025;1;10);DATE(2025;2;9);"D")
The retained original expectations are 5 complete years and 30 days. These formulas use uppercase units; the current cited section lists lowercase codes and does not explicitly specify case-insensitivity. Their arithmetic is checked, while uppercase acceptance has not been newly tested natively. For direct conformity with the documented strings, use "y" and "d" in the same formulas.
Five anniversaries occurred between the January 1 dates. The January 10 to February 9 interval is a 30-day difference, not an inclusive count of every calendar date touched.
Example 3: test the anniversary boundary
=DATEDIF(DATE(2020;6;15);DATE(2026;6;14);"y")
=DATEDIF(DATE(2020;6;15);DATE(2026;6;15);"y")
Independent expected results are 5 and 6. Moving the end date by one day completes another anniversary. Simply subtracting 2020 from 2026 gives six for both cases and does not express the whole-year rule.
With interval "m", these same controls give 71 and 72 completed months. A result in months is not a count of distinct month names that appear between the two endpoints.
Example 4: compare all six units on an ordinary interval
Put =DATE(2020;1;15) in A2 and =DATE(2026;4;20) in B2. Use one unit per formula:
| Formula | Independent expected count |
|---|---|
| =DATEDIF(A2;B2;“y”) | 6 |
| =DATEDIF(A2;B2;“m”) | 75 |
| =DATEDIF(A2;B2;“d”) | 2287 |
| =DATEDIF(A2;B2;“ym”) | 3 |
| =DATEDIF(A2;B2;“md”) | 5 |
| =DATEDIF(A2;B2;“yd”) | 95 |
The selected dates avoid missing anniversaries and short-month day borrowing. Six complete years leave a January 15 to April 20 remainder. That remainder contains three complete months plus five days, or 95 days when only full years are removed.
Do not add the total month count 75 to the residual month count 3; they are different descriptions of the same interval. Nor are all six outputs additive components of one duration.
Advanced example: audit the vendor’s complete breakdown
The official example uses 17 April 1974 through 13 June 2012. Its expected values are 38 years, 1 residual month, 27 residual days, 457 total months, 13937 total days and 57 days after the latest anniversary.
Those values can be independently reconciled: 38×12+1=457, and the period from 17 April to 13 June 2012 is 57 days. The final residual days run from 17 May to 13 June, giving 27.
This documented ordinary-date example supports the distinction between total and residual units. It does not establish every leap-day or month-end convention.
Advanced check: contrast a fixed reference with a changing one
For a reproducible service-length control, use a fixed end date in B2. Replacing it with TODAY changes the question to a recalculating current-date report. Record the date used when comparing results later; do not save only the resulting count and discard its reference date.
DATE constructs the controls, while YEAR extracts a calendar label. NETWORKDAYS counts eligible workdays and answers a different question.
Limits and error handling
The selected Collabora page does not establish a complete exact-error matrix for equal or reversed dates, malformed interval strings or every text conversion. Its instruction requires a later end date, so equal/reversed controls are held rather than assigned a borrowed error code.
Month-end and leap-day behavior for residual units also remains unverified here. The older article’s warning from Microsoft’s MD documentation is not product-specific proof about Collabora. The revised guide uses Collabora’s own definition and explicitly bounded ordinary-date examples instead.
Related guides
References and verification
The complete older guide and original formulas were reviewed. Calendar calculations are independent expectations under the explicit conditions above; volatile functions were not executed, and retained source conflicts are not certified native behavior.