+ Reply to Thread
Results 1 to 5 of 5

Search text Between a range

  1. #1
    Registered User
    Join Date
    05-10-2011
    Location
    Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    36

    Search text Between a range

    Hi Guys,

    Need to search a single word in a column range.
    For example I want to search "apple" In my attached sheet.

    "apple" may lie in any column.
    I want as I search "apple" any column range containing the same word got filter.

    Thanks in advance

    Cheers
    Attached Files Attached Files

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Search text Between a range

    I'd recommend using a helper column in your posted workbook.

    G1: Flag
    G2: =COUNTIF(B2:F2,"*apple*")>0

    Copy that formula down through G13

    To only view rows where at least one of the cells contains: Apple
    ...Filter on the Flag column for the value: TRUE.

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    01-29-2010
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel XP, Excel 2003, Excel 2007
    Posts
    27

    Re: Search text Between a range

    What I would suggest is that you write an expression in a new column, that should look sth like "=FIND("apple";CONCATENATE(A1;A2;A3...))" or within the whole row. Then apply the filter to this new column.
    FIND will return as integer with the starting position. if it does not find the string, it will return #value, and you can use the functions to handle this error in a user-friendly manner.

  4. #4
    Registered User
    Join Date
    05-10-2011
    Location
    Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Search text Between a range

    Hey Ron,

    yes Its working But there is problem in case if its written "apples" then it shows the result FALSE. Help me with that also.

    Quote Originally Posted by Ron Coderre View Post
    I'd recommend using a helper column in your posted workbook.

    G1: Flag
    G2: =COUNTIF(B2:F2,"*apple*")>0

    Copy that formula down through G13

    To only view rows where at least one of the cells contains: Apple
    ...Filter on the Flag column for the value: TRUE.

    Is that something you can work with?

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Search text Between a range

    Quote Originally Posted by nittin123goel View Post
    Hey Ron,

    yes Its working But there is problem in case if its written "apples" then it shows the result FALSE. Help me with that also.
    I'm not seeing that issue. If I change cell E4 from "all pharma" to "all apples pharma"...the formula result for that row (G4) changes from FALSE to TRUE.
    Can you post a specific example of the problem?

+ 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