+ Reply to Thread
Results 1 to 10 of 10

Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

  1. #1
    Registered User
    Join Date
    01-01-2010
    Location
    Manila
    MS-Off Ver
    Excel 2007
    Posts
    9

    Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

    Hi,

    I have data coming in from a source (e.g. Oracle database, 3rd party app) that I have no control over the date formats - currently dd/mm/yyyy hh:mm:ss. When I paste the date values on Excel, they get converted to mm/dd/yyyy hh:mm:ss. I want excel to not convert it to that format but still recognize them as dates so I can use MONTH(), DAY(), and other date arithmetic functions. Would anyone know how to do this without exploring to VBA?
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

    Hi Winterburn,

    Dates in your sample file are in dd/mm/yyyy hh:mm:ss format only and it seems excel recognized all of them as dates and allows for further calculations / manipulations i.e. when I use =month() or =date() function against any of them it works fine.

    Am i missing something here?

    Thanks.
    If solved kindly remember to mark Thread as solved.
    Click the small star icon at the bottom left of my post if this was useful.

  3. #3
    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: Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

    Try using TExt to columns option.
    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.

  4. #4
    Registered User
    Join Date
    01-01-2010
    Location
    Manila
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

    Hi,

    I used text to columns to separate the date and the time, along with AM/PM options. But that's what's weird. Some columns are recognized as full datetime so they have AM/PM, but some don't have (those with the first value >=12, since it defaults to mm/dd/yyyy). I have uploaded a new sheet showing the MONTH() result of a column, and it considers the leftmost value as month. You can see there that the first value is 1 instead of 11 for 01/11/2012 date. Some "unrecognizable" data have #VALUE! in them.
    Attached Files Attached Files

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

    Re: Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

    Hi

    Have a look at the attached, might be of help.

  6. #6
    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: Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

    See the example,pls.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-01-2010
    Location
    Manila
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

    Hi Fotis,

    Thanks! This solution works. How were you able to do it?

  8. #8
    Registered User
    Join Date
    01-01-2010
    Location
    Manila
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

    On second check, the 3rd column you did Text to Columns to does not reflect the right dates. The data is ordered based on "Open Time", and the first entry is November 1, 2011, not January 11, 2011.

  9. #9
    Registered User
    Join Date
    01-01-2010
    Location
    Manila
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

    Hi Kevin UK,

    I've used your formula to get an idea of how to extract each datetime parameter and sum them up once they have been converted to DATE() and TIME() values. Thanks for your help!

    Here's the result.
    Attached Files Attached Files

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

    Re: Source is ddmmyyyy, but converts to mmddyyyy once pasted to excel

    Hi Winterburn

    Glad you got it sorted, I was in a hurry and misread your post.
    Those formula's in Columns B,C,D.F,G & H if you wrap them in a VALUE function, +0 or use the double unary operator at the start. They will return numbers instead of text if you require that.
    EG:
    =--IF(your formula etc)

    =VALUE(IF(your formula etc)

    =IF(your formula etc)+0

    Kevin

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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