using datedif formula

M

marie

I am using a datedif formula to calculate an employee's number of years
worked. I have the hire date and current(sheet) date. I have used the
formula
=datedif(cellwithcurrentdate,cellwithhiredate,"y"). The return is
1/17/1900. What am I doing wrong?
 
R

Rick Rothstein

You aren't doing anything wrong... that is just Excel trying to be helpful
(it saw you working with dates, so it gave you its answer as a date)... just
Format the cell to General and it will report 17 as the result.
 
D

David Biddulph

I would have expected an error, as (assuming that hire date is in the past)
the syntax would be
=datedif(cellwithhiredate,cellwithcurrentdate,"y") not
not =datedif(cellwithcurrentdate,cellwithhiredate,"y")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top