+ Reply to Thread
Results 1 to 6 of 6

Comparing a cell value against a range of values

Hybrid View

  1. #1
    Registered User
    Join Date
    11-08-2013
    Location
    South Yorkshire
    MS-Off Ver
    Excel 2010
    Posts
    3

    Comparing a cell value against a range of values

    Hi all,
    I have a spreadsheet which has a column of data (actually, shopping SKU's). Another column (shorter) has a another list of SKU's, some of which are the same as in the first column. I'm using Excel's MATCH function to, well, match them in a true of false. But as the range extends to more than 3000 lines, I'm struggling to increment the formula eg: turn
    =OR(EXACT(A1, B1:B1000))
    into
    =OR(EXACT(A3000, B1:B1000))
    .

    It's probably quite straightforward, but can anyone show me...?

    Thanks

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Comparing a cell value against a range of values

    You probably just need to lock the range reference to B1:B1000

    Try
    =OR(EXACT(A1, B$1:B$1000))


    Also, Match will be MUCH more efficient than that.
    Unless Capitalization is important (jon should NOT be considered a match for JON)

    =ISNUMBER(MATCH(A1,B$1:B$1000,0))

  3. #3
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Comparing a cell value against a range of values

    Hi Ali
    Put this formula in the first row and copy down:

    =OR(EXACT(A1, $B$1:$B$1000))

    Good luck.
    Tony

  4. #4
    Registered User
    Join Date
    11-08-2013
    Location
    South Yorkshire
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Comparing a cell value against a range of values

    That works great thanks!!

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Comparing a cell value against a range of values

    You're welcome.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Comparing a cell value against a range of values

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Comparing values in a range
    By leslieharris in forum Excel General
    Replies: 2
    Last Post: 08-02-2012, 01:53 AM
  2. Replies: 1
    Last Post: 06-26-2012, 08:50 AM
  3. Return a range of values by comparing to a list
    By Neutralizer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2010, 03:53 AM
  4. Comparing values in a range
    By solnajeff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-28-2007, 08:34 PM
  5. Comparing a Range of Values
    By jpx in forum Excel General
    Replies: 4
    Last Post: 11-22-2005, 06:30 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