I want the years since a date and today.
I tried this function:
=YEARS(7/16/2012,TODAY(),1)
but it returns 1900.
JAMES-2 wrote
=YEARS(7/16/2012,TODAY(),1)
The literal date needs to be quoted: =YEARS("7/16/2012",TODAY(),1)
Best wishes, Owen.
Your first argument is 7 divided by 16 divided by 2,012. This is approximately 0.00022, representing - as a date and time - nineteen seconds after midnight on the date origin. So I'd expect the result to be 115. But in any case it won't have anything to do with a date in July 2012.
The arguments of YEARS() need to be numeric dates, so I think you need something like
=YEARS(DATE(2012,7,16),TODAY(),1)
or
=YEARS(DATEVALUE("7/16/2012"),TODAY(),1)
I trust this helps.
Brian Barker
I tried:
=YEARS(DATE(2012,7,16),TODAY(),1)
I still get "1900".
The cell format is YYYY.
I set the cell format to numeric and got what I want.
I want the years since a date and today. I tried this function:
=YEARS(7/16/2012,TODAY(),1)
but it returns 1900.Your first argument is 7 divided by 16 divided by 2,012. This is approximately 0.00022, representing - as a date and time - nineteen seconds after midnight on the date origin. So I'd expect the result to be 115. But in any case it won't have anything to do with a date in July 2012.
The arguments of YEARS() need to be numeric dates, so I think you need something like
=YEARS(DATE(2012,7,16),TODAY(),1)
or
=YEARS(DATEVALUE("7/16/2012"),TODAY(),1)I tried:
=YEARS(DATE(2012,7,16),TODAY(),1)
I still get "1900".
The cell format is YYYY.
Oh, well you will. The result of this formula is 2 (meaning two years) but if you interpret this number as a date it represents two days after the date origin - which is indeed a date within the year 1900.
I set the cell format to numeric and got what I want.
Good-oh!
Brian Barker