← All functions

DATEDIF

Quirk found

Category: Date and time · Last tested 2026-07-04

Support matrix

EngineDocumentedLive-testedVerdict
Excel Yes Not yet n/a
Google Sheets Yes Not yet n/a
LibreOffice Calc Yes Yes (24.2.7.2, 2026-07-04) Quirk found

Discovered quirks

Executed test cases

LibreOffice Calc 24.2.7.2 (tested 2026-07-04)

FormulaDescriptionResultExpectedVerdict
=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