+ Reply to Thread
Results 1 to 11 of 11

Create date from text

Hybrid View

  1. #1
    Registered User
    Join Date
    10-11-2022
    Location
    Texas
    MS-Off Ver
    office365 subscription
    Posts
    8

    Create date from text

    I have an application that generates CSV info. It reports dates in the form "DD MM YYYY". For example "11 23 2021". This is a change in the application. It used to report dates as "11/23/2021" which was easy to import into my spreadsheet. it now imports as text and I cannot treat it as a date.

    How can I either get Excel to treat it as a date or convert it to a date Excel can work with?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,329

    Re: Create date from text

    If the date is in cell A2, try
    Formula: copy to clipboard
    =SUBSTITUTE(A2," ","/")+0
    and format as date.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,329

    Re: Create date from text

    You might even get away with a global replace of space by forward slash (can't test at the moment).

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

    Re: Create date from text

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

  5. #5
    Registered User
    Join Date
    10-11-2022
    Location
    Texas
    MS-Off Ver
    office365 subscription
    Posts
    8

    Re: Create date from text

    Getting close, I think, but that results in 3 separate cells, side by side. I want to change "11 23 2023" to "11/23/2023".

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Create date from text

    See post #2.

    Or select the column > Find & Replace.

    Find: " " (space without the quote marks - just hit the spacebar!
    Replace: /
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,329

    Re: Create date from text

    Quote Originally Posted by AliGW View Post
    See post #2.

    Or select the column > Find & Replace.

    Find: " " (space without the quote marks - just hit the spacebar!
    Replace: /
    Post #3, maybe?

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,757

    Re: Create date from text

    Completely missed that, Trevor - sorry!

  9. #9
    Registered User
    Join Date
    10-11-2022
    Location
    Texas
    MS-Off Ver
    office365 subscription
    Posts
    8

    Re: Create date from text

    Yes, I have been negligent.

    I couldn't figure out why none of the suggestions were working out! I finally realized it was due to my mistake. The mistake is, I got confused about the actual format, which expresses the date as "Nov 21 2023" NOT "11 21 2023". The 11 21 2023 was from an experiment I was using while trying to work things out! Once I plugged the actual data into my REAL scenario, things no longer worked.

    SO my REAL problem is converting the text "Nov 21 2023" to a date useable in an Excel formula! I have a string of dates that I want to average out. I know, it sounds like a dumb idea, but it works for me and has been working until my source changed its format. It has to do with making a plot of a data points over time and sometimes only having start and end times for some data points.

    In "real life" I need to deal both with several-day spans and just a few-minute spans. In the long run, there are date+time timestamps being plotted (not just dates). I have other ways to deal with this, like taking min or max instead of average, or making multiple plots (both min and max) but for now a simple average suffices.

    Sorry for my stumbling around!
    Last edited by bertilak45; 11-01-2023 at 12:39 PM.

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,329

    Re: Create date from text

    @Ali: no worries

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

    Re: Create date from text

    See file with "Custom Format"
    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. [SOLVED] Create conditional formatting using date-time / text
    By Halidat in forum Excel General
    Replies: 8
    Last Post: 10-19-2021, 05:45 AM
  2. Create Date in Text format
    By jlausier in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-05-2021, 10:00 AM
  3. [SOLVED] Adjoin date & text to create unique identifier
    By Prof Sick in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-21-2020, 10:55 PM
  4. Create automatic text if it is already due date
    By roozutrinity in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-16-2018, 10:49 PM
  5. Create a cell of text based on a date
    By cbjfan2009 in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 02-17-2015, 07:38 AM
  6. Save date as text and create folder
    By Directlinq in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2009, 07:56 AM
  7. create date from text
    By davegb in forum Excel General
    Replies: 12
    Last Post: 01-12-2006, 07:10 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