+ Reply to Thread
Results 1 to 5 of 5

Formatting Dates

Hybrid View

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    36

    Formatting Dates

    I received a spreadsheet today and the person who send it to me entered the dates in this format: 6.9.24

    Excel doesn't recognize this as a date so I cannot reformat the cells or sort the range by date.

    Any idea how to write a formula that could change the format to "6-9-2024"? I've attached a sample spreadsheet.

    Thank you!
    Attached Files Attached Files

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

    Re: Formatting Dates

    You can use this formula in B2:

    =DATE(20&RIGHT(A2,2),LEFT(A2,FIND(".",A2)-1),SUBSTITUTE(MID(A2,FIND(".",A2)+1,2),".",""))

    Format as a date in the style you prefer, then copy down as required.

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Formatting Dates

    Are you still using Excel 2003?
    It limits the the solutions we could offer.

  4. #4
    Forum Contributor
    Join Date
    01-13-2016
    Location
    Sheffield, England
    MS-Off Ver
    2016
    Posts
    216

    Re: Formatting Dates

    To convert the date format "6.9.24" to "6-9-2024" in Excel, you can use a combination of text functions like LEFT, MID, and RIGHT. Here's a formula you can use:

    =IFERROR(DATE(2000+RIGHT(A1,2),MID(A1,3,FIND(".",A1)-3),LEFT(A1,FIND(".",A1)-1)),"Invalid Date")

    Here's a breakdown of how the formula works:
    • LEFT(A1,FIND(".",A1)-1): This extracts the day part of the date before the first dot.
    • MID(A1,3,FIND(".",A1)-3): This extracts the month part of the date between the first and second dots.
    • RIGHT(A1,2): This extracts the year part of the date after the second dot. We assume that the year is in the format of YY, so we add 2000 to convert it to YYYY format.
    • DATE(year, month, day): This function constructs a date using the extracted day, month, and year parts.
    • IFERROR(...,"Invalid Date"): This handles cases where the date format is not valid.

    You can place this formula in a separate column and drag it down to apply to all the dates in your spreadsheet. Once you have the converted dates, you can format them as "dd-mm-yyyy" to display them in the desired format.

    Please note that this formula assumes that the day, month, and year parts of the date are separated by dots. If your actual data has a different separator or format, you may need to adjust the formula accordingly.

  5. #5
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,418

    Re: Formatting Dates

    No formulas
    Data-->Text to Columns-->Next-->Next-->Date-->MDY-->Finish
    Attached Files Attached Files

+ 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. Replies: 5
    Last Post: 12-03-2020, 01:45 PM
  2. Replies: 11
    Last Post: 05-04-2014, 08:28 PM
  3. [SOLVED] Conditional Formatting Due dates and Completed Dates
    By shansen79 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-30-2014, 01:33 PM
  4. Conditional Formatting with approaching due dates and completed dates
    By rogernation in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-13-2013, 04:12 PM
  5. Replies: 2
    Last Post: 11-26-2013, 11:04 AM
  6. Replies: 4
    Last Post: 08-29-2013, 11:23 AM
  7. [SOLVED] Conditional Formatting of: dates within 1 month and dates before today.
    By Luke Smith in forum Excel General
    Replies: 5
    Last Post: 06-18-2013, 07:29 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