+ Reply to Thread
Results 1 to 10 of 10

If column contains cell text

  1. #1
    Registered User
    Join Date
    03-28-2007
    Posts
    71

    If column contains cell text

    I am trying to return a "yes" if a column contains text in a referenced cell.

    ie A1 contains the word red. Somewhere in column B a cell has the word red, so it should return a yes. however, this isn't working, I can only get it to work if I type the word "red" in the formula. Unfortunately, my actual spreadsheet is a list of about 900 names and I don't want to type each one.

    Please help.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: If column contains cell text

    =if(B1=$A$1,"yes","no")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    03-28-2007
    Posts
    71

    Re: If column contains cell text

    I know how to find if two cells equal each other. What I'm am trying to do is find if it is somewhere in the 899 rows in a column.

    So, I have 2 databases that can each contain up to 899 employees. I am trying to find out if all the names on one are on the other. So, i need to return if a cell in the entire column contains the information.

    This formula works:
    =IF(ISNUMBER(SEARCH("name goes here",B1:B899)),"yes","no")

    but only if I actually type the name into the "name goes here". i would instead like to reference a cell that contains that name as reference.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: If column contains cell text

    Post # 3 was far more descriptive, thank you

    I resume you have tried...
    =IF(ISNUMBER(SEARCH($A$1,B1:B899)),"yes","no")

  5. #5
    Registered User
    Join Date
    03-28-2007
    Posts
    71

    Re: If column contains cell text

    Yes, I have and it always returns no. I even tried the "*"&A1&"*" and it still wouldn't find it.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: If column contains cell text

    can you upload a sample workbook (no sensitive data), showing what you are working with, and what your expected outcome would be?

  7. #7
    Registered User
    Join Date
    03-28-2007
    Posts
    71

    Re: If column contains cell text

    Okay. I actually figured it out on my own.

    thanks!!

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: If column contains cell text

    Great, its always a good feeling when you resolve your own questions

    Would you mind sharing what you did? That way, if another member searches for something similar, your answer will help them

  9. #9
    Registered User
    Join Date
    03-28-2007
    Posts
    71

    Re: If column contains cell text

    This is the formula I used.

    =IF(MATCH("*"&P2&"*",Sheet5!$N$2:$N$1000,0),"Yes","no")


    P2 being the cell containing the name and Sheet5!$N$2:$N$1000 containing the other list of names.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: If column contains cell text

    Fantastic, thank you very much

+ 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