+ Reply to Thread
Results 1 to 4 of 4

Formula to display cell if the text content partially matches a search term

Hybrid View

  1. #1
    Registered User
    Join Date
    07-08-2013
    Location
    Malta
    MS-Off Ver
    Excel 2007
    Posts
    7

    Question Formula to display cell if the text content partially matches a search term

    Good day,

    This thread relates to an earlier thread that I posted but is a different direction specifically pertaining to formulae.

    If I were to have a value in a cell in sheet 'Source' equal to "Sesame Street" (hey, its just an example :P )

    And another sheet 'Result' that displays or hides information based on whether the cell contents are equal to a 'search' cell contents:

    =IF(Source!C9=Result!$C$1,Source!C9,"")

    My intention would be to use this to display only when there is a match but here comes the tricky part:

    How would I modify the above to check if the , for example, *Sesa* where the contents of Result!$C$1 in the formula above is 'sesa' ?

    Any help appreciated
    Last edited by Avestron; 07-11-2013 at 04:10 AM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula to display cell if the text content partially matches a search term

    =IF(ISNUMBER(SEARCH(Result!$C$1,source!C9)),source!C9,"")
    Last edited by martindwilson; 07-11-2013 at 04:13 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-08-2013
    Location
    Malta
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Formula to display cell if the text content partially matches a search term

    Thank you very much martindwilson Thanks also benishiryo (sorry if I wasn't clear enough in the original post).

    With the minor modification: =IF(ISNUMBER(SEARCH(Result!$I$3,Source!D2)),Source!D2,"")

    and applying =IF(AND($D2<>"",Source!C2<>""),Source!C2,"") to all other cells on the same row,

    I now am able to filter out all sorts of unwanted rows from the Source sheet! It will greatly help me to perform my task for manual relinking (at least in terms of error avoidance).

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Formula to display cell if the text content partially matches a search term

    hi Avestron. a little confused which cells has what values. say Source!C9 contains "Sesame Street" & Result!$C$1 contains "Sesa", then:
    =IF(COUNTIF(Source!C9,"*"&Result!$C$1&"*"),Source!C9,"")

    if it's the other way round, then:
    =IF(COUNTIF(Result!$C$1,"*"&Source!C9&"*"),Source!C9,"")

    @martin:
    you added an extra quote here:
    =IF(ISNUMBER(SEARCH(Result!$C$1",source!C9)),source!C9,"")
    should be:
    =IF(ISNUMBER(SEARCH(Result!$C$1,source!C9)),source!C9,"")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ 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