View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Taking out string part which represents date

On 1 Feb 2007 16:59:27 -0800, "c8tz" wrote:

Hi,

I have a string eg.125-64-0502L where 0502 represents May 2002 - how
can i specify that without doing so manually.

thanks in advance for your assistance,

c8tz~


What do you mean by "specify that"?

If you mean to extract the last four digits and interpret them in terms of
month and year, then this formula should work:

=--TEXT(MID(A1,LEN(A1)-4,4),"00""/01/""00")

will return a serial date. Then format the cell:

Format/Cells/Number/Custom Type: mmm yyyy


Or, if you just want text, and not a serial date:

=TEXT(--TEXT(MID(A1,LEN(A1)-4,4),"00""/01/""00"),"mmm yyyy")

If you mean something else, please be more specific.

Best,
--ron