Forum Discussion
datedif function
- Feb 02, 2023
Rajen66 On a MBA myself. No problems with DATEDIF. But I wonder why you want to use that function at all. It's not an official Excel function and exists only for compatibility reasons with older spreadsheet programs (like Lotus-1-2-3).
If the earlier date is in A1 and the later date in B1 you can just use:
=B1-A1 and format the cell as a number, in stead of =DATEDIF(A1,B1,"d")
Rajen66 On a MBA myself. No problems with DATEDIF. But I wonder why you want to use that function at all. It's not an official Excel function and exists only for compatibility reasons with older spreadsheet programs (like Lotus-1-2-3).
If the earlier date is in A1 and the later date in B1 you can just use:
=B1-A1 and format the cell as a number, in stead of =DATEDIF(A1,B1,"d")
- sandipandAug 31, 2023Copper Contributor
Riny_van_Eekelen What If I want to calculate the months' gap between two dates instead of days?
- SergeiBaklanAug 31, 2023Diamond Contributor
- HansVogelaarAug 31, 2023MVP
Use "m" instead of "d". With start date in A1 and end date in B1:
=DATEDIF(A1, B1, "m")
or if you use comma as decimal separator:
=DATEDIF(A1; B1; "m")
- Rajen66Feb 02, 2023Copper ContributorHi Riny
You are quite correct, I found that out as well and switched over to the method you proposed. Goodluck with your MBA. I completed mine in 2010 and it really opened a different dimension on finding solutions to problems.- Riny_van_EekelenFeb 02, 2023Platinum Contributor
Rajen66 MBA as in Mac Book Air 🙂