+ Reply to Thread
Results 1 to 10 of 10

Converting text Date to Excel date

  1. #1
    Registered User
    Join Date
    07-22-2011
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2016
    Posts
    9

    Question Converting text Date to Excel date

    I have a large spreadsheet with column that contain dates in text format, but with a space at each end of the string. If I edit each cell to remove the spaces, the string converts to an Excel date. Is there a formula I can use in a looping macro to eliminate those spaces down the entire column?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Converting text Date to Excel date

    Hi,

    Rather than a macro why not just select the whole range of text dates and use Find [space] Replace [null]
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-22-2011
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Converting text Date to Excel date

    Richard: Thanks, but using Find[space] Replace[null] results in an error message saying Excel cannot find a match. And the Find & Replace box wants to work on the whole sheet, not just one column or range.

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Rather than a macro why not just select the whole range of text dates and use Find [space] Replace [null]

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Converting text Date to Excel date

    Hi,

    It worked for me when I replicated your description of text format dates with spaces, but it always helps if we can see the actual workbook. Would you upload iit please?

    Did you select the range of dates before specifying the Find/Replace?

  5. #5
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    279

    Re: Converting text Date to Excel date

    If Find/Replace is running on the entire sheet then you haven't selected a range, row or column.

    Does it matter if they are converted to dates? You can just add a number format to the column so they display however you want.

    Also, if you want to use a formula you don't then need a macro, just ensure that any cell references are relative then copy it down against all rows - you could try something like =MID(A1,2,LEN(A1)-2)

  6. #6
    Registered User
    Join Date
    07-22-2011
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Converting text Date to Excel date

    Thank you very much. That was not a function I'd used before, and it worked quite well.

  7. #7
    Registered User
    Join Date
    07-22-2011
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Converting text Date to Excel date

    I did, but the next reply solved the problem. Thanks for your help.

  8. #8
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Converting text Date to Excel date

    Hello vzw1965,

    first you have to append " ' " apostasy of each cell of date by making below formula:
    consider your Textdate column is A then write as formula in column B
    Please Login or Register  to view this content.
    then make value of column B
    Edit a cell and copy last space then select entire column of B and replace that copied text to blank

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Converting text Date to Excel date

    Quote Originally Posted by mohan.r1980 View Post
    Hello vzw1965,

    first you have to append " ' " apostasy of each cell of date by making below formula:
    consider your Textdate column is A then write as formula in column B
    Please Login or Register  to view this content.
    then make value of column B
    Edit a cell and copy last space then select entire column of B and replace that copied text to blank
    Text was implied in post #1 by virtue of the statement concerning the leading and trailing space characters

  10. #10
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Converting text Date to Excel date

    Hi Sir,
    i read the #1 post there is no concerning the leading space.

    his post is:
    I have a large spreadsheet with column that contain dates in text format, but with a space at each end of the string. If I edit each cell to remove the spaces, the string converts to an Excel date. Is there a formula I can use in a looping macro to eliminate those spaces down the entire column?

+ 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 Text to Number format to use in a VLOOKUP to polpulate data based by date
    By Rossovich in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-08-2015, 10:43 AM
  2. Converting Text to Date & Sorting on Date
    By andresndor in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-10-2014, 04:48 PM
  3. Converting text string that contains a date and time to a date
    By jmforde in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-12-2013, 02:31 PM
  4. Excel Date - Converting to Text?
    By heatwave in forum Excel General
    Replies: 3
    Last Post: 07-20-2010, 12:28 AM
  5. Converting date text to date format
    By reggie1000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2009, 06:10 AM
  6. Excel keeps converting to DATE, when I want text
    By Psy6 in forum Excel General
    Replies: 10
    Last Post: 05-27-2008, 03:17 AM
  7. [SOLVED] Excel keeps converting text to date format
    By John T via OfficeKB.com in forum Excel General
    Replies: 4
    Last Post: 09-12-2005, 02:05 PM

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