View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
 
Posts: n/a
Default extract year from the date in a cell

=YEAR(A1) will extract the year form a date in A1
and this will do the formatting
=INT(YEAR(A1)/1000)&" "&INT(MOD(YEAR(A1),1000)/100)&"
"&INT(MOD(YEAR(A1),100)/10)&" "&INT(MOD(YEAR(A1),10))
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"DKY" wrote in message
...

I have a cell with 01/01/2006 in it, and I'm trying to extract the 2006
but when I put =Left(b9,4) it returns 8718.
I'm also trying to pull the 2006 and put spaces in between it like so
2 0 0 6

Does anyone know how to do these two things?


--
DKY
------------------------------------------------------------------------
DKY's Profile:
http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=523216