Summary

Excel's DATEDIF function is widely used for calculating the difference between two dates in years, months, or days, but it will silently return buggy results in specific cases. DATEDIF2 is a custom LAMBDA function that replaces DATEDIF with reliable date arithmetic. This article explains the problems with DATEDIF, walks through the DATEDIF2 formula step by step, and shows where the two functions differ.

Was this page helpful?
Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.