+ Reply to Thread
Results 1 to 4 of 4

Formula to extract the text before one of two specific words

  1. #1
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Formula to extract the text before one of two specific words

    Morning all,

    Hopefully a quick and simple one. How can I extract the text that comes before one of two keywords ('Full' & 'YTD') and remove the trailing space? Example attached.

    Thanks in advance,

    Snook
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula to extract the text before one of two specific words

    Hi,

    =TRIM(LEFT(B4,MIN(SEARCH({"Full","YTD"},B4&"FullYTD")-1)))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Formula to extract the text before one of two specific words

    Hi XOR LX,

    That's not quite bringing back what I was looking for. For example the first cell returns "Dept F" when I would expect it to return "Dept".

    Edit: Did you tweak your solution because it works now?!?!

    Cheers,

    Snook

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula to extract the text before one of two specific words

    Quote Originally Posted by The_Snook View Post
    Hi XOR LX,

    That's not quite bringing back what I was looking for. For example the first cell returns "Dept F" when I would expect it to return "Dept".

    Edit: Did you tweak your solution because it works now?!?!

    Cheers,

    Snook
    Ah, sorry. Should've said something. Thought I'd 'tweaked' it in time for you not to notice! You were too quick! :-)

    Cheers

+ 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. How to extract diffrent words from text string with same formula
    By Zeb1980 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-21-2016, 07:50 AM
  2. [SOLVED] Extract specific words from large text
    By jesse030 in forum Excel General
    Replies: 7
    Last Post: 04-15-2016, 07:27 AM
  3. Replies: 15
    Last Post: 10-12-2014, 08:53 AM
  4. Extract words/numeric after each specific word
    By chweetvjy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-22-2014, 06:40 AM
  5. [SOLVED] looking formula for Extract Specific WORDs in existing LONG Words
    By santosh226001 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-07-2013, 08:21 AM
  6. How can i extract specific words from a cell?
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 30
    Last Post: 06-17-2013, 12:27 PM
  7. Extract specific words from cells
    By Santa-D in forum Excel General
    Replies: 6
    Last Post: 06-18-2006, 11:10 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