+ Reply to Thread
Results 1 to 7 of 7

Extract text from cell which includes a date?

  1. #1
    Registered User
    Join Date
    09-24-2015
    Location
    London, England
    MS-Off Ver
    Office 2013
    Posts
    31

    Extract text from cell which includes a date?

    Good Morning!

    I run reports daily and it would be a great to be able to separate the text and dates within the same narrative.
    They are always in the same format which hopefully makes it easier;

    Example date would look like the following;


    Narrative

    Smith John 01/01/2016 to 12/01/2016
    Smith John 13/01/2016 to 21/01/2016
    Monkhouse Bob 02/02/2016 to 05/02/2016
    Pan Peter 14/01/2016 to 21/01/2016

    In an absolute ideal world I would end up with data looking the below;

    Candidate From To
    Smith John 01/01/2016 12/01/2016
    Smith John 13/01/2016 21/01/2016
    Monkhouse Bob 02/02/2016 05/02/2016
    Pan Peter 14/01/2016 21/01/2016

    I've tried all sorts from with ISERRORS, LEN, FIND "/" etc. but I can't seem to crack it and now I'm beginning to wonder if it can even be done at all?

    Any help would be greatly appreciated (even if it to say it can't be done and put me out my misery!)
    Many, many thanks in advance!
    Laura

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Extract text from cell which includes a date?

    wrong formula
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

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

    Re: Extract text from cell which includes a date?

    Assuming your data starts in A1, use this (e.g. in B1) to get the name:

    =LEFT(A1,FIND("/",A1)-4)

    For the first date you can use this (e.g. in C1):

    =--MID(A1,FIND("/",A1)-2,10)

    Format the cell as a date. Use this in D1 to get the second date:

    =--RIGHT(A1,10)

    Again, format this as a date, then copy the formulae down as required.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    09-24-2015
    Location
    London, England
    MS-Off Ver
    Office 2013
    Posts
    31

    Talking Re: Extract text from cell which includes a date?

    Pete,

    I cannot thank you enough! It works perfectly!!

    Can I be really, really cheeky? Is there anyway to get a comma in-between the surname and first name once it's been stripped out of the text string?

    So Monkhouse, Bob

    As I said, sorry for being cheeky but if you don't ask . . .

    Thanks again & kindest regards,
    Laura

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

    Re: Extract text from cell which includes a date?

    Okay, the first formula would be as follows:

    =SUBSTITUTE(TRIM(LEFT(A1,FIND("/",A1)-4))," ",", ")

    i.e. change the space into a comma-space. I've used the TRIM function to remove any double spaces.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    09-24-2015
    Location
    London, England
    MS-Off Ver
    Office 2013
    Posts
    31

    Re: Extract text from cell which includes a date?

    Pete, if I could buy you a drink I would. . . .
    Thank you ever so much, it works perfectly!!

    I have never used the TRIM formula so will keep this mind. My issue with excel is that I don't know what I don't know even though I know it must be possible! My journey continues.

    Thanks again, Pete!

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

    Re: Extract text from cell which includes a date?

    You're welcome, Laura - glad to be able to help.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    As for the drink, well I'm in London in March ... (just joking).

    Pete

+ 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] Date Formatting when Formula Includes Text
    By phelbin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-12-2015, 03:39 PM
  2. Replies: 2
    Last Post: 03-17-2014, 12:14 PM
  3. [SOLVED] How to extract text data from one cell based on the date on another cell?
    By Prabhu.nanda in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-11-2013, 08:46 AM
  4. [SOLVED] Counting Cells that includes exact match and also if a cell includes specific text
    By smclachlan in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-19-2012, 07:42 PM
  5. How to extract numbers or a date from a text cell
    By TabishDilshad in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-20-2012, 06:43 AM
  6. Extract only text and numbers from a range that includes 0's and ""
    By emricki in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-26-2011, 04:19 PM
  7. [SOLVED] Text that includes data from a designated cell?
    By Blades in forum Excel General
    Replies: 2
    Last Post: 06-27-2006, 08:10 AM

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