DATEDIF
Quirk foundCategory: Date and time · Last tested 2026-08-06
Real, executed compatibility results for the DATEDIF function across Microsoft Excel, Google Sheets, and LibreOffice Calc — verified by actually running it. Syntax and links to each vendor’s official documentation are below.
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel | Yes | Not yet | n/a |
| Google Sheets | Yes | Not yet | n/a |
| LibreOffice Calc | Yes | Yes (25.8.7.3, 2026-08-06) | Quirk found |
LibreOffice version history
We executed the same test cases under each LibreOffice release to show exactly when DATEDIF’s support changed — not documentation claims, real results.
| LibreOffice version | Verdict | Tested |
|---|---|---|
| 24.2.0.3 | Quirk found | 2026-07-19 |
| 24.8.7.2 | Quirk found | 2026-07-19 |
| 25.2.0.3 | Quirk found | 2026-07-24 |
| 25.8.7.3 | Quirk found | 2026-08-06 |
Why isn't DATEDIF working in LibreOffice?
DATEDIF exists in LibreOffice 25.8.7.3, but it is not a drop-in match for
Excel — our executed tests found real behavioral differences (detailed in the test results on this
page). If a formula that works in Excel or Google Sheets misbehaves in LibreOffice, compare your usage
against the failing cases above before assuming your data is wrong.
Discovered quirks
- =DATEDIF(DATE(2024,1,10),DATE(2024,1,1),"D") on LibreOffice Calc returned #VALUE!, but the documented/expected result is #NUM!. Microsoft docs state end<start raises #NUM!; record engines' ACTUAL error code here since this is a known point of cross-engine divergence; MISMATCH vs expected: expected '#NUM!', got '#VALUE!'
Executed test cases
LibreOffice Calc 25.8.7.3 (tested 2026-08-06)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =DATEDIF(DATE(2020,1,1),DATE(2023,6,15),"Y") | Whole years between two dates | 3 | 3 | Matched |
| =DATEDIF(DATE(2020,1,1),DATE(2023,6,15),"M") | Whole months between two dates | 41 | 41 | Matched |
| =DATEDIF(DATE(2024,1,1),DATE(2024,1,10),"D") | Whole days between two dates | 9 | 9 | Matched |
| =DATEDIF(DATE(2024,1,31),DATE(2024,3,1),"MD") | "MD" (days ignoring months and years) is documented by Microsoft as unreliable/buggy for some date combos | -1 | -1 Textbook-naive expectation might be ~1, but MD has a well-known Microsoft-acknowledged bug around month-end dates; recording the ACTUAL engine output is the point of this test |
Matched |
| =DATEDIF(DATE(2024,1,10),DATE(2024,1,1),"D") | End date before start date -> #NUM! per Microsoft's documented DATEDIF behavior | #VALUE! | #NUM! Microsoft docs state end<start raises #NUM!; record engines' ACTUAL error code here since this is a known point of cross-engine divergence |
Mismatch |
Docs & syntax
- Excel: official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation
Related how-to recipes
- How to calculate age in years from a birth date
- How to calculate age in years and months
- How to calculate the number of days between two dates
- How to calculate the number of months between two dates
- How to calculate the next birthday (or anniversary) date