+ Reply to Thread
Results 1 to 5 of 5

Remove everything apart from date in cells

  1. #1
    Registered User
    Join Date
    03-12-2021
    Location
    Bahrain
    MS-Off Ver
    365
    Posts
    28

    Remove everything apart from date in cells

    Hi

    I have a range of cells which contain dates in the format dd/mm/yyyy plus a bunch of other text.
    I'm looking for a way to remove everything apart from the date so that the cell can be used in a formula.

    Thinking maybe regex would be a good way but not sure where to start.

    Don't need to validate the date so a text match would work.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,640

    Re: Remove everything apart from date in cells

    There are instructions at the top of the page on how to post a sample sheet.Thanks

  3. #3
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Remove everything apart from date in cells

    Formula based
    Please Login or Register  to view this content.
    Regex Based
    Please Login or Register  to view this content.
    Or

    Please Login or Register  to view this content.
    To convert directly to a date (you may don't need DateValue, since I have different regional settings)
    Please Login or Register  to view this content.
    Last edited by JEC.; 01-04-2022 at 11:34 AM.

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Remove everything apart from date in cells

    I have a range of cells which contain dates in the format dd/mm/yyyy plus a bunch of other text.
    I'm looking for a way to remove everything apart from the date
    Is it date in some cells and text in others
    A1 = 05/01/2022
    A2 = Text
    Please Login or Register  to view this content.
    Or is it date and text combined in cells...
    A1 = 05/01/2022Text
    A2 = 05/01/2022OtherText

    Please Login or Register  to view this content.
    Change red snippets above to your range...
    Last edited by Sintek; 01-05-2022 at 02:39 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Registered User
    Join Date
    03-12-2021
    Location
    Bahrain
    MS-Off Ver
    365
    Posts
    28

    Re: Remove everything apart from date in cells

    Thanks for the replies. All work well.
    It's for date and text combined in cells.

    In the end I went with the formula, but noticed that some dates were like ##/##/##, so modified it slightly to this.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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] Remove duplicate date lines in cells
    By brentjohn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-13-2018, 01:48 PM
  2. Replies: 2
    Last Post: 05-08-2017, 11:33 AM
  3. Replies: 9
    Last Post: 11-23-2016, 12:22 PM
  4. [SOLVED] Remove specific text from a cell and than sort cells by month and date
    By Boo123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2014, 05:05 PM
  5. Replies: 1
    Last Post: 03-02-2011, 09:25 PM
  6. Remove auto date function in cells
    By TKassis in forum Excel General
    Replies: 3
    Last Post: 05-12-2006, 02:20 PM
  7. remove a year from date value in mulitple cells
    By kb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-13-2005, 03: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