PC Review


Reply
Thread Tools Rate Thread

convert 1006 to date (01/10/2006)

 
 
=?Utf-8?B?TWFheA==?=
Guest
Posts: n/a
 
      12th Mar 2007
I have the following requirement. In a cell i have dates that have been
imported
from another system. They are entered as follows,

1206 would be December 2006
605 would be June 2005
0101 would be January 2001
There are no date older than 0101.

I would like to convert the cells or copy to new cells in the following
format 01/12/2006. Because there is no specific day of the month in the
original data i am happy to have 01 as the default.

is this easily achievable?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      12th Mar 2007
=DATE(2000+RIGHT(A1,2)*1,LEFT(A1,LEN(A1)-2),1)

--
Gary''s Student
gsnu200710


"Maax" wrote:

> I have the following requirement. In a cell i have dates that have been
> imported
> from another system. They are entered as follows,
>
> 1206 would be December 2006
> 605 would be June 2005
> 0101 would be January 2001
> There are no date older than 0101.
>
> I would like to convert the cells or copy to new cells in the following
> format 01/12/2006. Because there is no specific day of the month in the
> original data i am happy to have 01 as the default.
>
> is this easily achievable?
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      12th Mar 2007
try this. Notice the ONE dot before the items in the with statement.
Sub dodatefromtext()
For Each c In Selection
With c
.Value = DateSerial(Right(c, 2), Left(c, Len(c) - 2), 1)
.NumberFormat = "dd/mm/yyyy"
End With
Next c
End Sub


--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Maax" <(E-Mail Removed)> wrote in message
news:2B9A7D74-D265-4D59-B4FA-(E-Mail Removed)...
>I have the following requirement. In a cell i have dates that have been
> imported
> from another system. They are entered as follows,
>
> 1206 would be December 2006
> 605 would be June 2005
> 0101 would be January 2001
> There are no date older than 0101.
>
> I would like to convert the cells or copy to new cells in the following
> format 01/12/2006. Because there is no specific day of the month in the
> original data i am happy to have 01 as the default.
>
> is this easily achievable?
>



 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      12th Mar 2007
Orginal posting of the question answered.

--
Regards,
Tom Ogilvy


"Maax" wrote:

> I have the following requirement. In a cell i have dates that have been
> imported
> from another system. They are entered as follows,
>
> 1206 would be December 2006
> 605 would be June 2005
> 0101 would be January 2001
> There are no date older than 0101.
>
> I would like to convert the cells or copy to new cells in the following
> format 01/12/2006. Because there is no specific day of the month in the
> original data i am happy to have 01 as the default.
>
> is this easily achievable?
>

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      12th Mar 2007
Just some added information:
Gary's response provides an actual date serial number which can be used in
further calculations. To have it appear as you specify, you would need to
format the cell with the formula with the appropriate date format you want to
see.

--
Regards,
Tom Ogilvy

"Gary''s Student" wrote:

> =DATE(2000+RIGHT(A1,2)*1,LEFT(A1,LEN(A1)-2),1)
>
> --
> Gary''s Student
> gsnu200710
>
>
> "Maax" wrote:
>
> > I have the following requirement. In a cell i have dates that have been
> > imported
> > from another system. They are entered as follows,
> >
> > 1206 would be December 2006
> > 605 would be June 2005
> > 0101 would be January 2001
> > There are no date older than 0101.
> >
> > I would like to convert the cells or copy to new cells in the following
> > format 01/12/2006. Because there is no specific day of the month in the
> > original data i am happy to have 01 as the default.
> >
> > is this easily achievable?
> >

 
Reply With Quote
 
=?Utf-8?B?TWFheA==?=
Guest
Posts: n/a
 
      12th Mar 2007
Hi Gary, thanks very much, exactly what i needed.

"Gary''s Student" wrote:

> =DATE(2000+RIGHT(A1,2)*1,LEFT(A1,LEN(A1)-2),1)
>
> --
> Gary''s Student
> gsnu200710
>
>
> "Maax" wrote:
>
> > I have the following requirement. In a cell i have dates that have been
> > imported
> > from another system. They are entered as follows,
> >
> > 1206 would be December 2006
> > 605 would be June 2005
> > 0101 would be January 2001
> > There are no date older than 0101.
> >
> > I would like to convert the cells or copy to new cells in the following
> > format 01/12/2006. Because there is no specific day of the month in the
> > original data i am happy to have 01 as the default.
> >
> > is this easily achievable?
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert date to financial year format 2006-07 =?Utf-8?B?WW9nIFJhag==?= Microsoft Excel Worksheet Functions 4 19th May 2007 07:45 AM
Convert date format from 20060801 to 1st Aug 2006 (or similar)? =?Utf-8?B?ZXhjZWxfaXJhdGU=?= Microsoft Excel Misc 5 5th Sep 2006 05:12 PM
turn off convert text to date (i.e. 4-9 to April 9, 2006) jjj912@yahoo.com Microsoft Excel Worksheet Functions 4 13th Jun 2006 04:25 PM
Convert date text (not field)? e.g. from 5/7/06 to May 7, 2006 =?Utf-8?B?S2ltYmVybHlXUA==?= Microsoft Word Document Management 4 8th May 2006 10:18 PM
How do I change a date format 3/14/2006 to 3-14-2006 in Excel 2002 =?Utf-8?B?SmVycnkgVC4=?= Microsoft Excel Misc 2 15th Mar 2006 09:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:33 AM.