+ Reply to Thread
Results 1 to 6 of 6

Change the order of the date inside a cell

  1. #1
    Registered User
    Join Date
    10-04-2013
    Location
    Szentendre, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    78

    Change the order of the date inside a cell

    Hi guys,

    I have a column with dates. But I need them in backward order.
    The format of the cells (the whole column) is text and it should remain that, so to change the format of the cell is not an option.
    What formula can cause the following result?

    'A' column is the original, 'B' column is the desired one.

    A
    A B
    1 2016-10-10 10-10-2016
    2 2016-10-10 10-10-2016
    3 2016-10-11 11-10-2016
    4 2016-10-12 12-10-2016
    5 2016-10-12 12-10-2016
    6 2016-10-12 12-10-2016

    And so on...

    Thank you all!

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    2012 for Mac at home
    Posts
    7,227

    Re: Change the order of the date inside a cell

    How about something like this... =RIGHT(A1,2)&"-"&MID(A1,6,3)&LEFT(A1,4)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider (Windows 10)
    Posts
    49,033

    Re: Change the order of the date inside a cell

    You can use the text to columns feature to change the format of a date.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  4. #4
    Registered User
    Join Date
    10-04-2013
    Location
    Szentendre, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Change the order of the date inside a cell

    Thank you, indeed, using right, left, mid, thank you!

  5. #5
    Registered User
    Join Date
    10-04-2013
    Location
    Szentendre, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Change the order of the date inside a cell

    Quote Originally Posted by AliGW View Post
    You can use the text to columns feature to change the format of a date.
    Thanks, but it isn't an option, because I am using a foreign language excel version (hungarian) and when I import a CSV it changes the formats of the date, so I should import as TEXT, and later, I have to compare with other dates, which are also in text format...

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

    Re: Change the order of the date inside a cell

    You could shorten it a bit, by including both hyphens within the MID term:

    =RIGHT(A1,2)&MID(A1,5,4)&LEFT(A1,4)

    Hope this helps.

    Pete

+ 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] Macro to change 1) part of string, 2) the order of characters inside a string, 3) format
    By Karl Gustaf Karsten in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2015, 11:51 AM
  2. [SOLVED] Change one number in a cell inside a formula to a variable that is getting higher (+1)
    By chablo309 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-06-2015, 07:28 AM
  3. rearranging order of text string inside a cell
    By Milan Limbachia in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-19-2012, 05:01 PM
  4. Replies: 1
    Last Post: 05-10-2012, 11:51 PM
  5. Change date format inside rename formula
    By BLopes in forum Excel General
    Replies: 2
    Last Post: 06-23-2010, 10:44 AM
  6. Change Cell Ref inside a formula
    By dht in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2006, 06:20 PM
  7. [SOLVED] How protect function inside cell from change
    By ytumeh in forum Excel General
    Replies: 1
    Last Post: 04-28-2005, 02:06 AM

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