+ Reply to Thread
Results 1 to 4 of 4

"IF" with range in Excel

Hybrid View

  1. #1
    Registered User
    Join Date
    11-02-2011
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    2

    "IF" with range in Excel

    Is it possible to to write a formula that references another cell and compares it with a range of other cells to produce an either/or result?

    In other words, if I am looking at a name in a cell, and I want to know whether or not that name is also found within a range of other cells containing various names, how would I write the formula?

    While not a serious example of an Excel formula, I'm thinking of something that would duplicate the intent of the following faux formula (with apologies to SQL):

    =IF(A2(in(B2:B14)),"yes",no")

    Basically, is there a way to produce the effect of the imaginary "in" function in the faux formula above?
    Last edited by b_madoff; 11-02-2011 at 01:42 PM. Reason: Solved

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,328

    Re: "IF" with range in Excel

    Hi b_madoff and welcome to the forum,

    The thread of http://www.excelforum.com/excel-prog...g-a-value.html is very similar to your question and might solve it.

    Read it and then supply a sample of what you have if the above doesn't help.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    11-02-2011
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: "IF" with range in Excel

    Quote Originally Posted by MarvinP View Post
    Hi b_madoff and welcome to the forum,

    The thread of http://www.excelforum.com/excel-prog...g-a-value.html is very similar to your question and might solve it.

    Read it and then supply a sample of what you have if the above doesn't help.
    Thanks, that did it. My version looks like =IF(COUNTIF($F$4:$F$9,H4)>0,"yes","no")
    Last edited by b_madoff; 11-02-2011 at 01:50 PM. Reason: oops!

  4. #4
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: "IF" with range in Excel

    =IF(OR(A1=B1:B16),"yes","no") not sure of the SQL equivalent query though
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

+ 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