+ Reply to Thread
Results 1 to 6 of 6

Date and format problem!

Hybrid View

codonnell Date and format problem! 05-06-2007, 12:49 PM
olasa Text Date to DateValue 05-06-2007, 01:17 PM
daddylonglegs Hello Christopher, how are... 05-06-2007, 01:17 PM
codonnell Almost there! 05-06-2007, 01:29 PM
olasa Just saw the attatchment 05-06-2007, 01:45 PM
codonnell Got it! 05-06-2007, 01:59 PM
  1. #1
    Registered User
    Join Date
    05-06-2007
    Posts
    5

    Date and format problem!

    This problem has been killing me - and a BIG thanks to anyone who can help figure this out....

    I have a third party application that exports dates in European format (DD/MM/YYYY) and I want to format as US (MM/DD/YYYY). To make matters worse - the format is inconsistent and sometimes appears as D/MM/YYYY.

    Using format cells won't work - example: My cell contains 06/02/07 and if I use format cell to change to 'DD-MMM' the output will read as June 2 and not February 6 (the real value I want).

    It would seem I need a solution that rearranges the data. Is it possible to have excel rearrange the data - perhaps by the position of the '/'? Example: swap 06/02/07 for 02/06/07. The solution would need to apply to 6/02/07 as well.

    One other related problem: Some of these date cells are in a 'general format'. Even after applying a format change so that is numeric and in date form I cannot manipulate the cell format - it reads the same no matter what I do. Example: A2 = 30/01/07 and is in general format. After ANY format change it reads as 30/01/07.

    Raw data is attached. Please help!!

    Christopher
    Attached Files Attached Files
    Last edited by codonnell; 05-06-2007 at 01:03 PM. Reason: Added worksheet of dates

  2. #2
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    Text Date to DateValue

    This is a simple way of converting the text to Excel data value:
    =DATE(2000+RIGHT(A1,2),MID(A1,4,2),LEFT(A1,2))

    If there are blanks at the beginning or the end, use: =TRIM(A1)

    Hope it helped
    Ola

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,721
    Hello Christopher,

    how are you importing the data? You might be able to specify the format when you import using the import wizard.

    Once you have data in the spreadsheet you should be able to convert to dates using this formula in B1 copied down

    =IF(ISTEXT(A1),DATE(RIGHT(A1,4),LEFT(RIGHT(A1,7),2),LEFT(A1,FIND("/",A1)-1)),DATE(YEAR(A1),DAY(A1),MONTH(A1)))

    format as required, e.g. m/d/yy

    If you want to replace the original column with the corrected dates then copy column B and use Edit > Paste Special > values to paste into column A

  4. #4
    Registered User
    Join Date
    05-06-2007
    Posts
    5

    Almost there!

    Daddy - your formula worked great with cells that were properly formatted as date - but I have many cells that contain a date but in general format. No matter what I do I can't change these cells into a date format.

    Sample attached

    Thanks all for the quick help!
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    Just saw the attatchment

    Here is the file, with all dates converted.
    It worked here, but I had to change ÅÅ to YY for you, so I hope it works.
    //Ola
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-06-2007
    Posts
    5

    Got it!

    Thanks to Ola and Daddy - I'm all hooked up!!

    Christopher

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1