+ Reply to Thread
Results 1 to 18 of 18

Converting text to date

  1. #1
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Converting text to date

    Hi

    Can anyone help me to make a formula that convert the text 05/30/2019 into 30.05.19?
    I have tried with formating the cell. Using datevalue, and =date(right,left,mid). None of them seems to do the trick.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Converting text to date

    What was the DATE formula you tried, and what happened? The basic syntax you posted is correct.
    Rory

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Converting text to date

    Try this
    in B1
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 5/30/2019 30.05.19
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Converting text to date

    Real date or text looking like date? A sample sheet would help

  5. #5
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Converting text to date

    I just get a #value error, or the exact same date as in a1. See sample sheet
    Attached Files Attached Files

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Converting text to date

    I recommend converting all of the dates at once.

    This can be done by highlighting the column > Data > Text to Columns > Next > Next > Date: MDY > Finish

  7. #7
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Converting text to date

    cell A1 will have new date, together with a lot of other cells, many times over again. that's why I want a formula that converts it, so I don't need to change the value manually

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Converting text to date

    Agree with 63falcondude; by far the most practical option.

    A couple of formula alternatives, assuming the original entry is always of the form mm/dd/yyyy:

    1) Office 365: =0+CONCAT(MID(A1,{4,1,7},{3,3,4}))

    2) All versions: =0+(MID(A1,4,3)&MID(A1,1,3)&RIGHT(A1,4))

    In both cases format the cell as Custom/dd.mm.yyyy

    Regards
    Click * below if this answer helped

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

  9. #9
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Converting text to date

    Quote Originally Posted by XOR LX View Post
    1) Office 365: =0+CONCAT(MID(A1,{4,1,7},{3,3,4}))
    This was the solution that worked!
    (the one with converting all the cells at once doesn't work when I pass a new date in with 05/30/2019, as it doesn't convert it to 30.05.2019 without me manually going through the converting process again)

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Converting text to date

    Ok, glad to help!

    Cheers

  11. #11
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Converting text to date

    Hi
    Suddenly I can get the formula to work anymore. See attached spreadsheet
    Attached Files Attached Files

  12. #12
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Converting text to date

    A1 is a date, not text.

  13. #13
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Converting text to date

    Aaa, thank you that made it correct again. I have a problem though, every time I paste the values into the spreadsheet, the cell that I chose as text now automatically changes to date, is there any way to make the cell stay as a text cell even though something is paste into it?

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Converting text to date

    When you paste, use paste value. That way the formatting of the cell will remain unaltered.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  15. #15
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Converting text to date

    Why? Why not just test if it's a number (dates are stored as numbers) and if it is, use it directly, otherwise convert it using the formula you had originally.

  16. #16
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Converting text to date

    If I paste 06/11/2019 as values I get 43775 in the text box, which gives me 15/07/2106 in the cell where the formula is

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Converting text to date

    Ignore me - I misunderstood what you are copying. Sorry!

  18. #18
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Converting text to date

    I found the problem, Calculation options seems to go back to Manual when I past something into the cells. It works when I past the values and the option is set to manually. It's when I change it to automatic and then past the values (no matter how), that they seems to change to date automatically (as it probably recognize how the value is written, or something like that).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Weird error: converting text date to date format
    By rjcarlantonio in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-18-2018, 02:04 PM
  2. Converting text date into real date
    By ammartino44 in forum Excel General
    Replies: 4
    Last Post: 03-06-2018, 04:22 AM
  3. Need help converting text to date for merging date entries
    By oladunk in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-04-2017, 03:22 AM
  4. [SOLVED] Converting text Date to Excel date
    By vzw1965 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-01-2016, 09:01 AM
  5. [SOLVED] Converting Date Text to Number format to use in a VLOOKUP to polpulate data based by date
    By Rossovich in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-08-2015, 10:43 AM
  6. Converting text string that contains a date and time to a date
    By jmforde in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-12-2013, 02:31 PM
  7. Replies: 0
    Last Post: 01-30-2013, 07:05 PM

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