+ Reply to Thread
Results 1 to 2 of 2

Screening cell contents and replacing text.

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    Kansas City, Missouri
    MS-Off Ver
    Excel 2007
    Posts
    7

    Screening cell contents and replacing text.

    I'm looking for a way to screen the text in particular cell and then replace the certain text that is in that cell.
    Example:
    A2 on sheet 1 is populated manually. This cell could contain abc 1234 or set 4567.
    In sheet 2 A2 should look at sheet 1 A2, determine if it contains abc or set.
    If it has abc, replace that with xxx (which would then be xxx 1234 in sheet 2 A2)
    If it has set, replace that with nnn (which would then be nnn 4567 in sheet 2 A2)

    I tried using an "or" with a replace(search) but it didn't like it. Which actaully tells me I probably did it wrong.
    I have started with this..=REPLACE('sheet1'!Q2,SEARCH("abc",'sheet1'!Q2),6,"xxx")

    Thanks.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,819

    Re: Screening cell contents and replacing text.

    Try it this way:

    =SUBSTITUTE(SUBSTITUTE(Sheet1!A1,"abc","xxx"),"set","nnn")

    Hope this helps.

    Pete

+ 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