+ Reply to Thread
Results 1 to 3 of 3

Delete partial text

Hybrid View

  1. #1
    Registered User
    Join Date
    09-02-2008
    Location
    Cincinnati
    Posts
    5

    Delete partial text

    I need to pull a text string from one column and move it over to a new column but if it has the word "Ingredients" in it I need to only copy the text before the word "Ingredients". My problem is that if the word "Ingredients" is not there I get the error #value!.

    The formula i am using is =LEFT(E2,SEARCH("Ingredients",E2)-1)

    Thanks.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Something like:

    =IF(ISNUMBER(SEARCH("Ingredients",E2)),LEFT(E2,SEARCH("Ingredients",E2)-1),"No Ingredients")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    =LEFT(E2,SEARCH("Ingredients",E2&"Ingredients")-1)
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ 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. Text Box name changing, macro to delete not working
    By NMullis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2008, 05:43 PM
  2. Delete Text Only
    By Sirishgreen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-24-2007, 08:54 AM
  3. Delete date/time in all rows from a text
    By ramsdesk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-28-2007, 01:36 AM
  4. Entering text but not being able to delete it
    By spowell in forum Excel General
    Replies: 5
    Last Post: 05-01-2007, 04:06 PM
  5. Select & Delete text in TextBox1 also deletes text in TextBox2
    By heinousanus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2006, 08:02 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