Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Joliette, Quebec, Canada
    Posts
    290
    Thanks
    9
    Thanked 0 Times in 0 Posts

    aaaammjj problem (2003)

    I have csv data that is sent to me by a third party in which a date variable is in a text format. What is the simplest way to convert the this variable into a real date variable?
    I there a way to do this after it has opened with excel?
    1,20080102,
    2,20090106,
    3,20070707,

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: aaaammjj problem (2003)

    After the file is opened in excel and parsed the "text-date" should be in Col B. You can add this to a column to create the date:

    =DATE(LEFT(B1,4),MID(B1,5,2),RIGHT(B1,2))

    After copying down the row, you could copy and paste-values in Col B and delete the col with the formulas

    Steve

  3. #3
    2 Star Lounger
    Join Date
    Aug 2004
    Posts
    123
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: aaaammjj problem (2003)

    Asume your data located at Column B

    Column B
    B1 : 20080102
    B2 : 20090106
    B3 : 20070707

    Highlight your data >>
    click "Data" >>
    select "Text to Columns…" >>
    Step 1 of 3, click "Next" >>
    Step 2 of 3, click "Next" >>
    Step 3 of 3, at the "Column data format", choose "Date" and from the dropdrown list, choose "YMD" , and click "Next"
    Finish.

    Regards
    Bosco

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •