+ Reply to Thread
Results 1 to 4 of 4

Finding a different partial texts anywhere in a column

  1. #1
    Registered User
    Join Date
    02-04-2011
    Location
    boulder, co
    MS-Off Ver
    Excel 2003
    Posts
    74

    Question Finding a different partial texts anywhere in a column

    Hello,

    I feel like Im having a brain fart and this should be really easy.

    I've got 2 lists, say A:A and B:B. in column C I want to put an X if ANYWHERE in Column A my text in Column B appears.
    I tried =IF(A:A="*B1*","x",""). So, if anywhere in Column A contains B1, "X", else nothing. It doesn't give me an error, but nothing gets displayed when I know there should be an X.

    Example
    A B C
    adgh ej x
    oasid fe x
    sejbs tz
    ofep lm
    bdfej ad x
    Last edited by madadd; 03-02-2011 at 01:39 PM.

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

    Re: Finding a different partial texts anywhere in a column

    Try:

    =IF(COUNTIF(A:A,"*"&B1&"*"),"x","")

    or

    =IF(ISNUMBER(MATCH("*"&B1&"*",A:A,0)),"x","")

    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
    Registered User
    Join Date
    02-04-2011
    Location
    boulder, co
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Finding a different partial texts anywhere in a column

    Wow, thank you again. Both of those worked like a charm. I still don't understand what I did wrong. After looking at yours, I thought maybe changing my original to:

    =IF(A:A="*"&B1&"*","x","")

    would work, but no, no it doesn't.

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

    Re: Finding a different partial texts anywhere in a column

    By referencing A:A in =IF(A:A="*"&B1&"*","x","") you are not actually referencing the whole column, it just points to A1. Also, the wildcards don't work with formulas using = to evaluate a condition...

+ 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