View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 698
Default =YEAR(3/7/2007) in EXCEL, get the answer as 1900. Why?

Excel is actually performing the division indicated by 3/7/2007 to return
the numeric value of: 0.000213538330130258
which, as a date/time value is roughly 18 seconds into 01-JAN-1900

To indicate to Excel that you want the value converted to a date, use this
technique:
=YEAR(--"3/7/2007")

Excel will correctly interpret that you want to convert the text "3/7/2007"
into the date represented.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"LadyCat" wrote:

I am expecting the answer as 2007 from the function of =YEAR(3/7/2007)