+ Reply to Thread
Results 1 to 5 of 5

convert date in General format to date that can be sorted

  1. #1
    Registered User
    Join Date
    11-08-2022
    Location
    London, England
    MS-Off Ver
    365
    Posts
    3

    Question convert date in General format to date that can be sorted

    I need to convert the dates in the format "Janaury 25, 2022" into a "DDMMYYYY" format that can be sorted.

    Thanks!

    date.xlsx

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: convert date in General format to date that can be sorted

    The number format for the existing dates is unusual. I am not completely certain of the existing format.

    Where did these dates originate from ?

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

    Re: convert date in General format to date that can be sorted

    The dates in your sample are text strings and not real dates/numbers. The key to getting sortable dates is to get the dates stored as numbers. As long as they are stored as numbers, they should be sortable. Note that number format should have no impact on sort order. Common strategies for converting number stored as text to numbers: https://support.microsoft.com/en-us/...rs=en-us&ad=us

    In your sample, I was able to use Text to Columns to convert the text to numbers. Where you're in England and your operating system may have different default date/time settings, you may have to specify MDY dates at step 3 of the text import wizard or otherwise experiment to make sure you can reliably convert the text to date/number. ISTEXT() is a useful function for determining if the text to number conversion worked.

    Once the dates are correctly stored as numbers, you should be able to readily sort them. If you prefer a ddmmyyyy number format, you should be able to apply that as a custom number format code.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    11-08-2022
    Location
    London, England
    MS-Off Ver
    365
    Posts
    3

    Re: convert date in General format to date that can be sorted

    Hi Logit,

    These are dates extracted from profile information for those registered with an app

  5. #5
    Registered User
    Join Date
    11-08-2022
    Location
    London, England
    MS-Off Ver
    365
    Posts
    3

    Re: convert date in General format to date that can be sorted

    ok will try this
    thank you

+ 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] Converting Date & Time (General format) to Date (Date format)
    By supremenuts in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2017, 12:55 PM
  2. [SOLVED] convert general number to date format
    By Jhon Mustofa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-08-2014, 09:12 AM
  3. [SOLVED] Require vba or formula for convert general format data in date format
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-10-2013, 03:53 AM
  4. Convert from 'text' or 'general' to 'date' format
    By EmmieKae in forum Excel General
    Replies: 4
    Last Post: 07-11-2012, 02:30 PM
  5. [SOLVED] Convert a general format string to calendar date in Excel 2010 vba?
    By Kuriakos in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-18-2012, 11:44 AM
  6. Convert General Format to Date, Nested IF Function, If Yes then highlight row
    By woody04 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-21-2012, 05:01 AM
  7. Convert general format to date
    By NickC in forum Excel General
    Replies: 3
    Last Post: 02-06-2006, 11:30 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