View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Penny32 Penny32 is offline
external usenet poster
 
Posts: 3
Default why does excel 2007 subtract 2009 from 2015 = 1900?



"Glenn" wrote:

Penny32 wrote:
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?


What you are saying is "Year of 10 divided by 16 divided by 2015" which is the
same as "Year of .00031017369)".

What you want is this:

YEAR(DATEVALUE("10/16/2015"))

Or, put the dates in other cells and then reference those cells. With
10/16/2015 in A1 and 5/11/2009 in B1:

=(YEAR(A1)-YEAR(B1))*12+MONTH(A1)-MONTH(B1)
ok, did all that, but put the info into this as a date so u could see them. copied all the info from the excel help file. I used the formula exactly as written. Formmated the dates as =DATE(2009,4,28) as told. The date comes out in 1900's