Kate
Kate

Reputation: 455

Excel Date convert

I have date column like this

DEC07
SEP2007
SEP2008
JUN10
JUN09

how can I can convert this into MM/YYYY assuming DEC07 is 12/2007?

Upvotes: 0

Views: 41

Answers (2)

Scott Craner
Scott Craner

Reputation: 152660

This converts it to an actual date and not a string that looks like a date:

=IF(LEN(A1)=5,--REPLACE(A1,4,0,"20"),--A1)

Then format the cells:

mm/dddd

enter image description here

Upvotes: 1

Gary's Student
Gary's Student

Reputation: 96791

With data in A1, in B1 enter:

=MONTH(DATEVALUE("1 " & LEFT(A1,3) & " 2000")) & "/" & IF(LEN(A1)=5,2000+RIGHT(A2,2),RIGHT(A1,4))

and copy down.

enter image description here

The formula will handle both 2-digit years and 4-digit years.

Upvotes: 1

Related Questions