A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hello,
The below should work:
Regards
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I would like to have a cell that calculates how long an employee has been at their job. The cell next to it would have their start date, and I would like to have it switch over from months to years once they have been working there over a year. I tried this formula: =DATEDIF(TODAY(),F4,"ym") which results in a "#NUM!" response. Any suggestions?
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Hi there,
You have the arguments backwards. You're getting the #NUM! error because the start date is later than the end date. Put your reference first.
That being said, you can use something like this instead to overflow years, months, and days:
=IF(DATEDIF(F4,TODAY(),"y")>0,DATEDIF(F4,TODAY(),"y")&" years, ","")&IF(DATEDIF(F4,TODAY(),"ym")>0,DATEDIF(F4,TODAY(),"ym")&" months, ","")&DATEDIF(F4,TODAY(),"md")&" days"