+ Reply to Thread
Results 1 to 17 of 17

Can you Remove Terms from a String using a formula?

  1. #1
    Registered User
    Join Date
    12-09-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    68

    Can you Remove Terms from a String using a formula?

    So I have an interesting situation that I would normally just do a simple find and replace to remove the words I don't want, but with a hundred terms, its tough to do.

    I created a simple example to explain what I am trying to do, but I don't know the proper formula for column C.

    What I am looking for is a simple formula that will reference the words in the green, and scrub them out of column A.

    Any ideas?

    Thanks in advance!
    Aaron

    Remove Terms Example.xlsx

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Can you Remove Terms from a String using a formula?

    Maybe like this?

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




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

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

    Re: Can you Remove Terms from a String using a formula?

    Hi.

    =IFERROR(SUBSTITUTE(LOWER(A2),LOOKUP(1,0/COUNTIF(A2,"*"&$E$4:$E$7&"*"),$E$4:$E$7),""),A2)

    Copy down as required.

    This assumes that your entries in E4:E7 will be entirely in lower case, as they are in your sheet. Small adjustment if you can't guarantee this - just let me know.

    Regards
    Click * below if this answer helped

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

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Can you Remove Terms from a String using a formula?

    A couple of entries also have an extra space between word 1 and word 2, so use this instead...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Can you Remove Terms from a String using a formula?

    Hi,

    Check the updated file,

    Punnam
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-09-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Can you Remove Terms from a String using a formula?

    Hey Everyone,
    So this is awesome, thanks for the help. But in the example I attached, I added all the names I want removed in the front, but this might not be the case (it's only an example). So the formula which references right or left etc, won't work.

    Is there another way? What I am effectively trying to do is replace the word with nothing. So it's basicall a find and replace, but off of an entire column of keywords.

    Thoughts?

  7. #7
    Registered User
    Join Date
    12-09-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Can you Remove Terms from a String using a formula?

    XOR LX actually seemes to have the right formula... awesome.

    Let me check on those capital letters.

    Might be helpful to bake in the trim...

    Although, im not entirely sure I understand the formula in its entirety... Can you explain it?

  8. #8
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Can you Remove Terms from a String using a formula?

    You may try

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click just below left if it helps, Boo?ath?

  9. #9
    Registered User
    Join Date
    12-09-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Can you Remove Terms from a String using a formula?

    Looks like I will need the capital letters turned into lowercase ones in column E. Any ideas there?

  10. #10
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Can you Remove Terms from a String using a formula?

    Hi ,
    Have u checked my post 6 I have updated the file with a vlookup + & find Condition which will search for the specific names Listed in green Color

    Punnam

  11. #11
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Can you Remove Terms from a String using a formula?

    to turn Capital letter to lower use = Lower()
    Punnam

  12. #12
    Registered User
    Join Date
    12-09-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Can you Remove Terms from a String using a formula?

    right, I did that, but I want to get it into the formula some how. It's less important.

  13. #13
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Can you Remove Terms from a String using a formula?

    @ afriedman ,
    hi
    kindly address to whom the Post 12 is referring, as u r getting answers from various forum members

    Punnam

  14. #14
    Registered User
    Join Date
    12-09-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Can you Remove Terms from a String using a formula?

    I am referring to XOR LX....
    I am not sure your solution is going to help me.

  15. #15
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Can you Remove Terms from a String using a formula?

    afriedman

    Thanks for Replying .

    Punnam

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

    Re: Can you Remove Terms from a String using a formula?

    Quote Originally Posted by afriedman View Post
    I am referring to XOR LX....
    I am not sure your solution is going to help me.
    Sorry. Have been away.

    =IFERROR(TRIM(SUBSTITUTE(LOWER(A2),LOOKUP(1,0/COUNTIF(A2,"*"&LOWER($E$4:$E$7)&"*"),LOWER($E$4:$E$7)),"")),A2)

    Regards

  17. #17
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Can you Remove Terms from a String using a formula?

    Quote Originally Posted by XOR LX View Post
    Hi.

    =IFERROR(SUBSTITUTE(LOWER(A2),LOOKUP(1,0/COUNTIF(A2,"*"&$E$4:$E$7&"*"),$E$4:$E$7),""),A2)

    Copy down as required.

    This assumes that your entries in E4:E7 will be entirely in lower case, as they are in your sheet. Small adjustment if you can't guarantee this - just let me know.

    Regards
    Good to see that you have used countif that way...

    Regards,
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

+ 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. Need formula to remove brackets from string of numbers
    By happycats in forum Excel General
    Replies: 7
    Last Post: 07-11-2012, 09:19 PM
  2. Formula to Remove 2nd Number Group From String
    By chbrandt in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-03-2011, 03:37 PM
  3. Replies: 9
    Last Post: 11-03-2010, 11:42 AM
  4. formula to remove text at end of string???
    By richardeallen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-20-2008, 04:46 AM
  5. Remove characters from a text string using a formula
    By duncrbrt in forum Excel General
    Replies: 1
    Last Post: 06-03-2005, 10: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