+ Reply to Thread
Results 1 to 21 of 21

Converting date information to m/d/yyyy

  1. #1
    Registered User
    Join Date
    04-09-2021
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    10

    Converting date information to m/d/yyyy

    I run my computer with regional settings that present date information in "m/d/yyyy" format. I use an application that exports date information to Excel in "dd/mm/yy hh:mm AM/AP" format. Is there an Excel formula that I can use to convert this date/time information to a format that is recognizable by my computer? Ideally in "m/d/yyyy hh:mm" or simply "m/d/yyyy"? Greatful for any assistance with this one.

  2. #2
    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,460

    Re: Converting date information to m/d/yyyy

    Welcome to the forum.

    Does formatting the column not work for you? There are various ways that might work.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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.

  3. #3
    Registered User
    Join Date
    04-09-2021
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    10

    Re: Converting date information to m/d/yyyy

    Thanks for the quick reply AliGW and thank you for the welcome. I use this forum a lot as a reference tool but only registered today because I couldn't find resolution to this specific issue.

    The issue that I'm having is that my computer is not recognizing the "dd/mm/yy" date format because it is different from my computer's settings so the simple date conversion formulas won't work. For example, "13/03/2021" (Mar 13th) displays as "13/03/2021" while "12/03/2021" (March 12th) is recognized by excel as December 3rd in the same column of data. I've attached a sample file of the issue.
    Attached Files Attached Files

  4. #4
    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,460

    Re: Converting date information to m/d/yyyy

    In B2 copied down:

    =IF(ISNUMBER(A2),DATE(YEAR(A2),DAY(A2),MONTH(A2)),DATE(RIGHT(A2,4),SUBSTITUTE(MID(A2,FIND("/",A2)+1,2),"/",""),SUBSTITUTE(LEFT(A2,2),"/","")))

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

    Re: Converting date information to m/d/yyyy

    I'm sure there's a formula, but, before I started messing with formulas, I would look at the data import step. All you've said is that an external programs exports information to Excel. What does that export look like (is it directly into Excel, via something like a text/csv file, other process)?

    I'm also guessing that the dates in A2:A13 (3 Jan, 3 Feb, 3 Mar, etc.) are supposed to be 1 Mar, 2 Mar, etc., so that, even when Excel interprets it as a date, it is interpreting the wrong date.

    At this stage, I would probably be aiming towards a process that brings the data as text into Excel (don't let Excel automatically convert from text to date). Once the text dates are in Excel, you can use the Text Import Wizard to convert the text to date. There's a step during the Text Import Wizard that specifically allows you to tell Excel that the dates are DMY dates, so Excel can import correctly. If the outside programming is exporting to a text/csv type of file, you can make the text import wizard part of the import process into Excel. Without knowing exactly how you are going from one program to Excel, my first thought is to find a process that uses text as the intermediate step. Then I can control how Excel imports the text.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Registered User
    Join Date
    04-09-2021
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    10

    Re: Converting date information to m/d/yyyy

    Amazing, thank you! You don't know how much of a headache you've just saved me!!

    Can you share the formula to use to convert "dd/mm/yy hh:mm AM/PM" to "m/d/yyyy hh:mm"?

  7. #7
    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,460

    Re: Converting date information to m/d/yyyy

    If you share a workbook with the imported dates in that format, yes.

  8. #8
    Registered User
    Join Date
    04-09-2021
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    10

    Re: Converting date information to m/d/yyyy

    Thank you. Please see attached. See column 'M' in yellow for new date format.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Converting date information to m/d/yyyy

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    04-09-2021
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    10

    Re: Converting date information to m/d/yyyy

    Thanks Fluff13. This formula works for the first 12 days of the month which Excel recognizes as dates but not for the 13th onward. Interesting formula though. A few functions in there that I have not come across before.

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Converting date information to m/d/yyyy

    What do you get for M14 downwards?

  12. #12
    Registered User
    Join Date
    04-09-2021
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    10

    Re: Converting date information to m/d/yyyy

    The formula output produces the same result as the original data.

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Converting date information to m/d/yyyy

    Hadn't noticed your locale, which is why it doesn't work. Will the dates always be for year 2000+

  14. #14
    Registered User
    Join Date
    04-09-2021
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    10

    Re: Converting date information to m/d/yyyy

    Yes, definitely nothing from pre-2000.

  15. #15
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Converting date information to m/d/yyyy

    As I'm in England I cannot test this, but does this convert M14 into a date
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    04-09-2021
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    10

    Re: Converting date information to m/d/yyyy

    Yes, it works for M14 down but creates an error on M2 to M13. A combination of the two formulas could potentially work...

  17. #17
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Converting date information to m/d/yyyy

    I just needed to check it would work for M14, try this for all the data
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    04-09-2021
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    10

    Re: Converting date information to m/d/yyyy

    That's the one. Thanks for your help with this one Fluff13.

  19. #19
    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,460

    Re: Converting date information to m/d/yyyy

    Thanks for finishing this off! I had to go offline.

    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 all those who helped.

  20. #20
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Converting date information to m/d/yyyy

    Glad to help & thanks for the feedback.

  21. #21
    Registered User
    Join Date
    04-09-2021
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    10

    Re: Converting date information to m/d/yyyy

    Thanks guys! This is a great forum! I consider myself a very proficient Excel user but am humbled by other's capacities as well. 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. Converting date string dd/mm/yyy to date dd/mm/yyyy
    By Gunblade in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2021, 09:11 PM
  2. Replies: 2
    Last Post: 10-18-2020, 05:28 AM
  3. [SOLVED] Help need for converting a string date to yyyy-mm-dd
    By spittingfire in forum Excel General
    Replies: 10
    Last Post: 01-25-2020, 01:31 AM
  4. Converting date from various forms to mm/dd/yyyy format
    By Sud in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2012, 07:38 PM
  5. Converting Six Digit Number to MM/YYYY Date Format
    By bschmeec in forum Excel General
    Replies: 1
    Last Post: 12-22-2011, 06:55 PM
  6. Replies: 3
    Last Post: 12-14-2009, 12:04 PM
  7. Problems converting date from d/m/yyyy to mmmm format
    By dcgrove in forum Excel General
    Replies: 6
    Last Post: 07-22-2009, 01:25 PM

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