+ Reply to Thread
Results 1 to 3 of 3

Formula to search cells/columns containing specific text

  1. #1
    Registered User
    Join Date
    01-25-2010
    Location
    MA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Formula to search cells/columns containing specific text

    Hi,

    I would like to search on 2 columns, to see if each cell in Column B contains text from any cell in Column A.

    For example, IF the text in Column B (Email Address), Row 2 contains text from any cell in Column A (Domain) = True. Below is an example:

    (A) DOMAIN NAME | (B)EMAIL ADDRESS | (C)TRUE OR FALSE?
    hotmail.com | [email protected] | TRUE
    msn.com | [email protected] | TRUE
    web.com | [email protected] | FALSE
    domain.com | [email protected] | TRUE
    aol.com | [email protected] | TRUE
    site.com | [email protected] | TRUE

    I am currently using this formula:
    =IF(ISNUMBER(SEARCH($A:$A,E2)),"TRUE","FALSE")

    but it doesn't appear to be working. It only works if the matching rows are adjacent to each other. As you can see from the example above, the matching domains could be in any row, any cell.

    Would anyone know the correct formula for this? I've searched everywhere Thank you!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to search cells/columns containing specific text

    Try

    =ISNUMBER(MATCH(MID(E2,FIND("@",E2)+1,255),A:A,0))

    copied down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to search cells/columns containing specific text

    EDIT: disregard below - NBVC's approach above is much better


    I would suggest perhaps:

    Please Login or Register  to view this content.
    adjust ranges to suit but try to avoid using entire column references - the above is relatively expensive performance wise so keeping ranges lean is generally advisable
    (pre XL2007 entire column references would in fact generate #NUM! errors)

+ 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