View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default why does excel 2007 subtract 2009 from 2015 = 1900?

10 divided by 16 then divided by 2015 is a very small number, and as Excel
dates count from the beginning of 1900, the result of =YEAR(10/16/2015) will
be 1900. That presumably isn't what you want.
If you want 2015 you could, if you wanted, use =YEAR(DATE(2015,10,16)), or
of course you could just use =2015. If you put 10/16/2015 as a date into a
cell in Excel, assuming that your Windows Regional Settings use mm/dd/yyyy
as a date option, then =YEAR(cellref) would give 2015 as a result.

Note that even if you correct your formula, if you are working out a number
of months you would want to format the result as General or Number, not in
date/time format, or else a result of 23 months would display as 23rd
January 1900.
--
David Biddulph


"Penny32" wrote in message
...
have tried different formats for the dates, always comes up the same.
have
formated in date/time format,
=(YEAR(10/16/2015)-YEAR(05/11/2009))*12+MONTH(10/16/2015)-MONTH(05/11/2009)=
1/0/1900.....what is wrong here?