+ Reply to Thread
Results 1 to 7 of 7

Search Value in List of Values

Hybrid View

  1. #1
    Registered User
    Join Date
    04-16-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Search Value in List of Values

    Hello,

    I'm trying to see if a given value exists in a list of values. I could use COUNTIF for this, but I also came across this formula: =OR(INDEX(A1:A3=B2,)) It works, but does anyone know why? I'm not sure why exactly the OR() is needed and why the INDEX formula is working as it is.

    Any clarification is appreciated.

    Thanks,
    Ben

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Search Value in List of Values

    Ben,

    Index creates an array of values, in this case True/False for each comparison of cells A1:A3 to B2. So if A2 actually is equal to B2, then it would create an array of {FALSE,TRUE,FALSE}
    The OR function looks for any instances of TRUE and if it finds any, then the OR function returns TRUE, so in this example it would return TRUE because A2=B2. Only if there are no TRUE values at all will the OR function return FALSE.

    That all being said, there is no reason to use OR(INDEX over COUNTIF for this task.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    04-16-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Search Value in List of Values

    Hi Tigeravatar,

    Awesome, that makes total sense, thank you!


  4. #4
    Registered User
    Join Date
    07-16-2013
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Search Value in List of Values

    Hi I have a similar question, but a different twist.
    I need to match GL Codes in E91:E104 and drop the Project Name (cells F91:F104) value that matches the GL Code into the cell this formula is inserted in.

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Search Value in List of Values

    You're very welcome

    If that takes care of your need, please mark this thread as solved.
    How to mark a thread Solved
    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word "Title" you will see a dropdown with the words "No prefix"
    Change to "Solved"
    Click Save

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Search Value in List of Values

    "wadekranz",

    Welcome to the forum!
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

  7. #7
    Registered User
    Join Date
    07-16-2013
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Search Value in List of Values

    Thanks mate, shall do.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. search cell values based on list of values in other sheet and add color to row
    By darkbraids in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2012, 08:35 AM
  2. Search list and return multiple values
    By MarVil85 in forum Excel General
    Replies: 1
    Last Post: 06-23-2012, 03:46 PM
  3. Search list for known values
    By lanziniad in forum Excel Programming / VBA / Macros
    Replies: 88
    Last Post: 11-30-2011, 04:57 PM
  4. Search and list multiple values
    By skywalkman2007 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-28-2008, 02:05 PM
  5. search list for values
    By Bob B in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-08-2006, 12:20 PM

Tags for this Thread

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