+ Reply to Thread
Results 1 to 8 of 8

extract part of text

  1. #1
    Registered User
    Join Date
    09-01-2015
    Location
    Delhi, India
    MS-Off Ver
    2010
    Posts
    32

    extract part of text

    Hi I need to extract a part of text. Example:

    From: Deborah A Ellis [mailto:[email protected]] Sent: Tuesday, July 11, 2017 7:49 PM Subject: AURELIUS - Sale of Getronics Group completed - Biggest exit in history The previously announced EUR 220 million

    Herein I need to extract - "AURELIUS - Sale of Getronics Group completed - Biggest exit in history" this is part between subject: and double space before "The previously announced EUR 220 million"

    how can i do this ?

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: extract part of text

    with the whole text in A1 try

    PHP Code: 
    =MID(A1,SEARCH("subject:",A1)+9,SEARCH("  ",A1)-9-SEARCH("subject:",A1)) 

  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,812

    Re: extract part of text

    There isn't a double space in that string when I copy it from the forum (the forum software removes double spaces), but assuming it is there and the string is in A1, you can use this:

    =MID(A1,SEARCH("subject:",A1)+9,SEARCH(" ",A1)-SEARCH("subject:",A1)-9)

    Hope this helps.

    Pete

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: extract part of text

    Excel 2016 (Windows) 64 bit
    A
    1
    From: Deborah A Ellis [mailto:[email protected]] Sent: Tuesday, July 11, 2017 7:49 PM Subject: AURELIUS - Sale of Getronics Group completed - Biggest exit in history The previously announced EUR 220 million
    2
    AURELIUS - Sale of Getronics Group completed - Biggest exit in history The previously announced EUR 220 million
    Sheet: Sheet1

    A2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Registered User
    Join Date
    09-01-2015
    Location
    Delhi, India
    MS-Off Ver
    2010
    Posts
    32

    Re: extract part of text

    Thanks Roel , Pete and Ankur.

    @Ankur - I just need the text till history. After history there are 2 spaces.

  6. #6
    Registered User
    Join Date
    09-01-2015
    Location
    Delhi, India
    MS-Off Ver
    2010
    Posts
    32

    Re: extract part of text

    @Roel and Pete - thanks for helping but some how that formula inst working! its giving VALUE! error.

  7. #7
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: extract part of text

    Then try


    =TRIM(LEFT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(A1," ","@"),"Subject: ",REPT(" ",LEN(A1))),LEN(A1))),"@",REPT(" ",LEN(A1))),LEN(A1)))

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

    Re: extract part of text

    Quote Originally Posted by tushararora View Post
    @Roel and Pete - thanks for helping but some how that formula inst working! its giving VALUE! error.
    Check that you do actually have a double-space in the text. It may include a non-breaking space character (code 160).

    Hope this helps.

    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. Extract part of text from one cell with a long URL with folders - help!
    By darthtom6 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-06-2015, 01:47 PM
  2. Extract and Copy Part of Text String From one cell to another
    By Chica SM in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-22-2014, 10:39 AM
  3. Extract text left and right of character part 2
    By stuartm4h in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-01-2013, 07:12 AM
  4. Extract only certain part of text from a cell
    By Dimitripros in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-13-2013, 03:05 AM
  5. extract last part of a text string
    By TheShinE in forum Excel General
    Replies: 5
    Last Post: 09-23-2011, 01:02 PM
  6. Extract a part of Text file
    By parasbshah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2011, 02:55 PM
  7. Extract a part of a text string
    By MaxAlbertsson in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-03-2007, 07:48 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