+ Reply to Thread
Results 1 to 9 of 9

Excel 2007 : How do I find cell matches one of multiple criteria?

  1. #1
    Registered User
    Join Date
    02-15-2012
    Location
    Ithaca
    MS-Off Ver
    Excel 2003
    Posts
    18

    How do I find cell matches one of multiple criteria?

    In Column A, lets say I have a range of names.
    In Column B, I want to use an IF statement to identify IF the corresponding cell in A has the name Bob or Jill.

    This is what I thought it should be:

    IF(A1={"Bob", "Jill"}, 0,1)

    So when I use the fill handle for the entire column, everywhere with a "Bob" or a "Jill" should be a 0. Instead, it is only finding the "Bob" and not the "Jill". Am I missing some syntax issue here? Thanks if anyone can help.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: How do I find cell matches one of multiple criteria?

    You mean like this:

    =IF(OR(A1={"Bob", "Jill"}),0,1)

  3. #3
    Registered User
    Join Date
    02-15-2012
    Location
    Ithaca
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: How do I find cell matches one of multiple criteria?

    Yes, thanks. I knew I was missing something simple.

    And this was a "dummy" problem associated with something else I am doing. Hopefully now I can do it. If not, I will be back. Thumbs up for prompt reply!

  4. #4
    Registered User
    Join Date
    02-15-2012
    Location
    Ithaca
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: How do I find cell matches one of multiple criteria?

    OK I am back.

    So the big picture is I am trying to conditional format a range based on multiple criteria. In column A I have list of names. Column B is what I am trying to format. I am trying to create a formula such that whenever there is "Bob" or "Jill" in Column A, the corresponding cell in column B is highlighted. I tried using:

    =IF(OR(A1:A53={"Bob", "Jill"}, 0, 1)=0

    Any advice?

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: How do I find cell matches one of multiple criteria?

    Select A1 to A53 and use this for CF: =OR($A1="Bob",$A1="Jill")
    Attached Files Attached Files
    Last edited by zbor; 02-15-2012 at 04:38 AM.

  6. #6
    Registered User
    Join Date
    02-15-2012
    Location
    Ithaca
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: How do I find cell matches one of multiple criteria?

    So for 10 criteria, I would have to write each in that format?

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: How do I find cell matches one of multiple criteria?

    For 10, 100, 1000 criterias would be better to create list (for example in C column) and then you can use MATCH or COUNTIF or some other approach to check criteria.


    For example:

    =COUNTIF(C:C, A1)>0

  8. #8
    Registered User
    Join Date
    02-15-2012
    Location
    Ithaca
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: How do I find cell matches one of multiple criteria?

    Thanks. I am still learning the syntax such as references and how $A1 is different from A$1, and am learning if you mess that up, then you get a headache .

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: How do I find cell matches one of multiple criteria?

    It's very important part of the excel.
    Try look here for example: http://www.youtube.com/watch?v=NmVMjQzseLA

    And deal with it once for all

+ 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