I would recommend you read this article which I have posted elsewhere in this forum..

Recommendation: Do not use the undocumented DATEDIF function

and then consider using the code I have posted in this other article, also elsewhere in this forum...

UDF (user defined function) replacement for Excel's DATEDIF function