How to calculate time between two dates. What replaces datedif?

Copper Contributor

I need to calculate age in years between two dates. Help says use datedif, but the function does not appear in excel! I know there is a way to create a function that does this, but I haven't the algebraic ability.

Can someone help me with a formula?

5 Replies

@Lisainnj Which version of Excel are you using, on which platform? It is available in most versions, but not well documented in some of them.

Let's say you have dates in A2 and B2. Try entering =DATEDIF(A2,B2,"y") in another cell.

best response confirmed by Lisainnj (Copper Contributor)


In addition, there is no tooltip for DATEDIF(). You shall type it on your own, Excel shows nothing while you are entering function.

Alternatively you may use YEARFRAC function (

I'm use windows on a remote cloud service I'm subscribed to office 365
the datedif function does not show in excel and will not compute a value - even when i change cells and hand enter the equation example. i need another option to the no longer available function
no tooltip - and when typed, no calculation. thank you for the alternative to use.
This works -- if you follow exactly the correct syntax!