VB Script/Extract DAte from a string
Expert: Subbu - 5/18/2009
QuestionQUESTION: HI I have a column which contains data in the format :
l3=12/3/2009
l3=23/4/2009
...
...
I need to extract the date part from it...
I do not want to trim the first 3 characters and get the date out of it,,because i need to process the date further..
Is there any function that can accomplish that..
Thanks
ANSWER: Ashish,
There are two steps to get your dates.
Col A Col B
13=11/12/2008 39764 use =DATEVALUE(MID(A1,4,LEN(A1)-3)) to get 39764
13=11/3/2008 39755
13=11/2/2008 39754
Then select all date value cells, select Format Menu, Cells Option, select date format you want.
Another method is you can use VBA code to display date in date format directly. If you want VBA code I need some time to write it.
Thanks.
---------- FOLLOW-UP ----------
QUESTION: Hi thanks but this does not gives me the solution . The reason is the in the text format l3=11/12/2008,
dd = 11, mm=12, yyyy=2008
once i covert it into Date format after applying the formula u have givern, it returnas 12 November 2008 but as per my requirement it should be 11 December 2008
AnswerDid you try with changing date format in custom?
Steps:
1. select the Datevalue cells
2. Goto Format menu and select cells option
3. Select Custom from Category and apply various date formats what ever you want and check it for your final result.
Let me know still you have any trouble.