+ Reply to Thread
Results 1 to 4 of 4

=SUBSTITUTE Problem

Hybrid View

  1. #1
    Registered User
    Join Date
    08-16-2010
    Location
    Maidstone
    MS-Off Ver
    Excel 2007
    Posts
    7

    =SUBSTITUTE Problem

    I would like to be able to use OR in substitute, to say remove red or blue or green if it appears in cell.

    A1
    red tiger

    B1
    green turtle

    C1
    blue fish


    =SUBSTITUTE(A1,("red "or"blue "or"green "),"")
    Last edited by seanjacob; 09-23-2010 at 05:55 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: =SUBSTITUTE Problem

    Try this in D1
    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"red",""),"green",""),"blue","")
    Drag across to F1

    Hope this helps
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    08-16-2010
    Location
    Maidstone
    MS-Off Ver
    Excel 2007
    Posts
    7

    Smile Re: =SUBSTITUTE Problem

    Thank you very much Marcol,

    Shame that it couldn't be more simple.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: =SUBSTITUTE Problem

    I'm not a formula whizz-kid, perhaps it can be simplified?

    In the meantime you might also want to try
    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"red ",""),"green ",""),"blue ","")
    Note the space after the colour.

    or
    =TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"red",""),"green",""),"blue",""))
    these examples will remove leading spaces as in your sample data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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