Share via

Determining time worked in Excel

Anonymous
2017-01-11T16:22:09+00:00

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?

Microsoft 365 and Office | Excel | For home | Windows

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.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2017-01-11T17:26:11+00:00

    Hello,

    The below should work:

    Regards

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2017-01-11T17:29:10+00:00

    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"

    Was this answer helpful?

    0 comments No comments