+ Reply to Thread
Results 1 to 7 of 7

Pick out text from middle of a string

  1. #1
    Registered User
    Join Date
    11-06-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    2

    Pick out text from middle of a string

    Hello,

    So I have many lines of text all totally different lengths and I want to pull out the last date and time (highlighted in red on document)Date Time Forumla Help.xlsx

    The way I assume it can be done is by looking in from RIGHT to find ">on " and then taking the next 19 char. But that is a lot easier said than done!!
    (the lines of code are actually way longer than that, I shortened for the purpose of this post going from the left isn't an option)

    If anyone knows the code for this that would be greatly appreciated!

    Kind Regards
    Aaron

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Pick out text from middle of a string

    Try

    =MID(A2,SEARCH(">On",A2,1)+4,19)

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Pick out text from middle of a string

    Hi,

    Does this work for you?

    =MID(A2,3+FIND(">On ",A2),20)
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

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

    Re: Pick out text from middle of a string

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



    Regards, TMS
    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


  5. #5
    Registered User
    Join Date
    11-06-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    2

    Re: Pick out text from middle of a string

    Sorry guys all of these is pulling the date time at the start rather than the one on the far right.

  6. #6
    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
    44,461

    Re: Pick out text from middle of a string

    Edit: didn't look properly ...

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by TMS; 11-06-2015 at 08:48 AM. Reason: Replaced formula

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Pick out text from middle of a string

    A UDF alternative,
    =Finddate(A2) where A2 is your range(cells) and drag it down as you do with any formula.
    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] formula to pick out text in middle of string and return
    By Burt_100 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-24-2014, 05:32 PM
  2. Sort by text in the middle of a string
    By javeds in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-08-2014, 12:32 PM
  3. [SOLVED] How to remove dot(s) .. or ... in front of text string, not in a middle
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-23-2013, 05:45 PM
  4. [SOLVED] if formula looking at value in middle of text string
    By SAsplin in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-25-2013, 06:57 AM
  5. [SOLVED] pulling text from the middle of a string
    By DRFILL in forum Excel General
    Replies: 3
    Last Post: 09-21-2012, 11:35 AM
  6. Extract text from the middle of a string for concatenation
    By christopherp in forum Excel General
    Replies: 1
    Last Post: 05-16-2011, 08:55 AM
  7. delete middle part of text string
    By maacmaac in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-30-2009, 03:59 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