ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   using datedif formula (https://www.excelbanter.com/excel-worksheet-functions/212041-using-datedif-formula.html)

Marie

using datedif formula
 
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?

Rick Rothstein

using datedif formula
 
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.

--
Rick (MVP - Excel)


"marie" wrote in message
...
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?



David Biddulph[_2_]

using datedif formula
 
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")
--
David Biddulph

"Rick Rothstein" wrote in message
...
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.

--
Rick (MVP - Excel)


"marie" wrote in message
...
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?






All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com