+ Reply to Thread
Results 1 to 10 of 10

Converting differently-formatted US dates to UK dates

  1. #1
    Registered User
    Join Date
    07-05-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    74

    Converting differently-formatted US dates to UK dates

    The external database I am pulling data from shows dates in the US format and when I download the CSV it strips out any initial zero and, in these instances, also the '20' from 2012.

    So, whereas 01/17/2012 comes through as 17/01/2012, 07/06/2012 comes through as 6/07/12. (See attached).

    Unfortunately I can't amend the database settings.

    I can't seem to find a simple way to convert these back to UK dates and have been trying to work out the smallest amount of steps / formulae required to get these to UK format.

    Does anyone have any ideas?

    Glayva
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-05-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Converting differently-formatted US dates to UK dates

    Actually - I messed that explanation up didn't I... Sorry

    For some reason some of the cells are stripping out the zeros and '20's but others aren't. Probably best to see the attached spreadsheet for info.

    Thanks

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Converting differently-formatted US dates to UK dates

    Try...

    =IF(ISNUMBER(A1),A1,TEXT(A1,"dd/mm/yyyy"))

    and format as dd/mm/yyyy
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    07-05-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Converting differently-formatted US dates to UK dates

    Thanks Ace_XL but that just returns 00/01/1900

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Converting differently-formatted US dates to UK dates

    Hi

    One way could be using the Text to Columns option in your Excel sheet panel.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Registered User
    Join Date
    07-05-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Converting differently-formatted US dates to UK dates

    Thanks Fotis1991 - I used this on the cells which had numbers stripped out and concatenated the text in a final cell.

  7. #7
    Forum Contributor
    Join Date
    08-23-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: Converting differently-formatted US dates to UK dates

    I think the other workaround would be....
    1) convert all in one format with formula =IF(ISNUMBER(A1),A1,TEXT(A1,"dd/mm/yy"))
    2) paste special values
    3) Delimit as date format (DMY); do not use any other seperator
    Last edited by [email protected]; 09-10-2012 at 05:30 AM.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Converting differently-formatted US dates to UK dates

    Is this working properly, though? In your example you have 3 values that have been converted into dates, i.e. 7/01/2012, 7/02/2012 and 7/03/2012. However, I suspect that the "real" dates should be 1/07/2012, 2/07/2012 and 3/07/2012 - it's just that the numbers are small enough to be recognised as dates in the UK, but the month and day have been transposed. Do you want a formula that can give you the correct dates in all cases?

    Pete

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Converting differently-formatted US dates to UK dates

    Put this formula in B1:

    =IF(ISNUMBER(A1),DATE(YEAR(A1),DAY(A1),MONTH(A1)),DATE("20"&RIGHT(A1,2),LEFT(A1,SEARCH("/",A1)-1),MID(A1,SEARCH("/",A1)+1,2)))

    format as a date (dd/mm/yyyy), and then copy down.

    Hope this helps.

    Pete

  10. #10
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Converting differently-formatted US dates to UK dates

    Hi Glayva

    Assuming data is in A1:

    =IF(ISNUMBER(A1),A1,DATEVALUE(MID(A1,FIND("/",A1)+1,FIND("/",A1,FIND("/",A1)+1)-FIND("/",A1)-1)&"/"&LEFT(A1,FIND("/",A1)-1)&"/"&"20"&RIGHT(A1,2)))

+ 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