+ Reply to Thread
Results 1 to 5 of 5

(SOLVED) If first word = This array, then remove them and keep the rest

  1. #1
    Registered User
    Join Date
    11-21-2011
    Location
    boston, ma
    MS-Off Ver
    Excel 2007
    Posts
    25

    (SOLVED) If first word = This array, then remove them and keep the rest

    Hello,

    Hoping this is not a tricky task. I just want a function to remove the first word of each cell if the word is part of an array such as "fox" "horse" and "Cow."

    ie: Fox jumped over the cow
    Output: jumped over the cow

    Thank you!
    Last edited by agf12555; 12-21-2011 at 07:34 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,404

    Re: If first word = This array, then remove them and keep the rest

    Try this.. Define words in for example H column.
    Attached Files Attached Files

  3. #3
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,802

    Re: If first word = This array, then remove them and keep the rest

    For a non-VBA solution..

    If your sentences are in column A, then in B1 use the following formula and fill down:

    =IF(OR(LEFT(LOWER(A1),FIND(" ",A1)-1)={"fox","horse","cow"}),MID(A1,FIND(" ",A1)+1,LEN(A1)),A1)

    Copy the results from column B over the original values in column A (Copy, then PasteSpecial > Values).

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,646

    Re: If first word = This array, then remove them and keep the rest

    Please Login or Register  to view this content.



  5. #5
    Registered User
    Join Date
    11-21-2011
    Location
    boston, ma
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: If first word = This array, then remove them and keep the rest

    The first one worked great, so I'll stick with it. Thanks a lot guys!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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