+ Reply to Thread
Results 1 to 5 of 5

Return a Yes if a text is found within a cell

  1. #1
    Registered User
    Join Date
    11-27-2013
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    29

    Return a Yes if a text is found within a cell

    Hello,

    I currently have the below formula to search for text of interest (A1) within each cell of a column (B6:B30).

    =IF(ISERROR(MATCH(A1,$B$6:$B$30,0)),"NO","YES")

    The formula works perfectly if there is only a single value in the cells. But not so well when the cell has multiple values separated by a comma.

    For example:

    Column B

    X
    Y
    Z
    T, X, Y, Z

    It would return a "Yes" for X, Y, and Z because those are found individually. However, T will appear as a "No", because it is found within a cell that is separated by commas.

    Any suggestions on how I can modify this formula?

    I look forward to hearing from you, and thank all responses in advance.

    Merry Christmas!

  2. #2
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Return a Yes if a text is found within a cell

    One way for sub string search ..
    =IF(SUMPRODUCT(--ISNUMBER(SEARCH(A1,$B$6:$B$30)))>0,"YES","NO")
    ------------------------
    Works? Wave it, hit the little star at the bottom left of my responses

  3. #3
    Registered User
    Join Date
    11-27-2013
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Return a Yes if a text is found within a cell

    Perfection. Thank you!

  4. #4
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Return a Yes if a text is found within a cell

    welcome, glad to hear

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return a Yes if a text is found within a cell

    Here's another one...

    =IF(COUNTIF(B6:B30,"*"&A1&"*"),"Yes","No")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Search cell for multiple text , return comma separated text in separate cell if found
    By dangerdoug in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2013, 01:52 PM
  2. [SOLVED] If specific text is found in cell, then return a number
    By csch123 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-31-2013, 05:07 PM
  3. [SOLVED] Formula needed to return the text adjacent to the cell when found.
    By LMWI65 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-16-2012, 08:18 AM
  4. Replies: 4
    Last Post: 05-12-2011, 02:25 PM
  5. if text is found in cell return 1 else 0
    By jrtaylor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2011, 08:53 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