+ Reply to Thread
Results 1 to 7 of 7

Date formatting not working

  1. #1
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    222

    Date formatting not working

    Hi. This has been a problem on various files for years and I can't seem to solve it. In this case I downloaded bank transactions from a few different banks and removed all but the dates. The format I want them in is month, day , year which would look like 11/04/2021 for today's date. Currently the column lists the date with the day/mth/yr as 04/11/2021. I want to switch the day and month around.

    I have tried the following which works most of the time.
    1. Format column. Date, mm/dd/yyyy.
    2. Text to Columns, delimited, MDY.
    Tried both of these but I can't figure out how to reverse the day and month.

    Could use some help on this.

    Thank you.

    Peter
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Date formatting not working

    The only way I could manipulate the dates were to bring them into Power Query. Split them based upon the / symbol and then recombine them.

    Here is the Mcode

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Date formatting not working

    I wonder what you did differently, because, when I use Text to columns, it seems to work just fine:

    1) Select column A
    2) Call Text to Columns -> at the appropriate step, choose Date and DMY for the date type.
    3) Finish text to columns and evaluate.

    For the sample data, all dates are converted from text to number. Spot checking the actual dates, all dates appear to be correct.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    222

    Re: Date formatting not working

    Hi MrShorty. Yes, it works with day/month/year. I want to change to month/day/year

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Date formatting not working

    After using text to columns to convert from text to number, it should be a simple matter of applying an appropriate number format. My copy of Excel defaults to a month/day/year format, so I don't need to apply the number format. If your system defaults to date/month/year, then apply a suitable date format like "mm/dd/yyyy".

    Edit to add: Remember that, in the text import wizard, you are telling Excel how to read the text date. You are not telling Excel how you want it formatted after the import. Use number formatting after text to columns to get the desired format.

  6. #6
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    222

    Re: Date formatting not working

    Wow! I actually took some time and went through how to use the Power Query function. Never too old to learn.

    Much appreciated.

    Peter

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Date formatting not working

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Conditional Formatting on date - not working correctly
    By LeanneHMUA in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-25-2020, 07:48 AM
  2. [SOLVED] Conditional formatting not working with date function
    By conroypi in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-27-2019, 06:31 PM
  3. Date formatting not working
    By crouzilles in forum Excel General
    Replies: 2
    Last Post: 02-14-2015, 11:51 AM
  4. Replies: 7
    Last Post: 10-20-2014, 09:33 AM
  5. Date formatting doesn't seem to be working.
    By danallamas in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-02-2014, 03:31 AM
  6. [SOLVED] Date Formatting Not working
    By SallyW-EDUK in forum Excel General
    Replies: 2
    Last Post: 10-16-2012, 06:20 AM
  7. [SOLVED] Date formatting not working when date is linked from another sheet
    By kbquestions in forum Excel General
    Replies: 3
    Last Post: 04-14-2012, 09:43 AM

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