+ Reply to Thread
Results 1 to 4 of 4

If one cell equals a range of cells, return with true or false

  1. #1
    Forum Contributor
    Join Date
    05-29-2009
    Location
    sheffield
    MS-Off Ver
    Excel 2013
    Posts
    210

    If one cell equals a range of cells, return with true or false

    I have the following problem:-

    I want to see if A1 equals any of B1,B2,B3,B4 or B5 i.e anything from a list, and return with C1 or C2 i.e Yes or No.

    If I type in individually B1,B2,B3,B4 or B5 it comes up with the errror "too many arguments".

    If I type in the range B1:B5 it doesn't go through the range of cells and only does the IF equation if the cell equals B1, not any of B1,B2,B3,B4 or B5.

    The range B1:B5 is a list of text and not numbers so I can't use a greather than or less than sum.

    I hope I'm clear on what I'm trying to get at.

    Any help would be greatly appreciated.
    Last edited by johnmitch38; 05-29-2009 at 05:12 AM. Reason: title error

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

    Re: IF help needed please

    =IF(OR(A1=B1;A1=B2;A1=B3;A1=B4;A1=B5);C1;C2)

    (replace ; with , if needed)

  3. #3
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: If one cell equals a range of cells, return with true or false, help please

    =if(countif(b1:b5,a1),C1,C2)
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  4. #4
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: If one cell equals a range of cells, return with true or false

    =IF(OR(B1:B5=A1),C1,C2)

    is another way!

+ 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