+ Reply to Thread
Results 1 to 7 of 7

Check if range does NOT match another range

  1. #1
    Registered User
    Join Date
    05-29-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    58

    Check if range does NOT match another range

    I have two ranges of data one in column A, one in column B - the data varies in its content.

    I need a forumla that will check if all the data in col A also appears in col B and will alert me if it doesn't

    So for example lets say col A contains a load of colours
    BLUE
    GREEN
    BLACK
    RED
    BLUE
    GREEN
    RED
    BLACK
    GREEN
    ORANGE
    BLACK
    RED

    Col B contains the data to check against
    BLUE
    GREEN
    BLACK
    RED

    The formula in this case would return an alert because there is data in col A that does not appear in col B (ORANGE) - however if ORANGE was removed, there would be no alert, because everything that appears in col A also appears in col B.

    Thanks in advance for any support with this.

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Check if range does NOT match another range

    One way, provided that the Col B data is unique,

    =IF(SUMPRODUCT(COUNTIF(A1:A12,$B$1:$B$12))=ROWS($A$1:$A$12),"all data in col B appears in col A","NOT all data in col B appears in col A")

    see if that helps,

    berlan

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

    Re: Check if range does NOT match another range

    This will give a True/False result (True = all values in A exist in B)

    =SUMPRODUCT(--(ISNUMBER(MATCH(A1:A12,B1:B4,0))))=ROWS(A1:A12)

  4. #4
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,307

    Re: Check if range does NOT match another range

    I offer this option.
    Excel 2003
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Czeslaw; 11-04-2015 at 04:58 PM.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,533

    Re: Check if range does NOT match another range

    Use Conditional formatting

    Formula

    =ISERROR(MATCH($A1,$B$1:$B$4,0))

    FILL with required colour

  6. #6
    Registered User
    Join Date
    05-29-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: Check if range does NOT match another range

    Thanks all, is there a way to make the same thing work, but where the initial list in is col a and the second is row 1

    ie col A contains a load of colours
    BLUE
    GREEN
    BLACK
    RED
    BLUE
    GREEN
    RED
    BLACK
    GREEN
    ORANGE
    BLACK
    RED

    Row 1 contains the data to check against
    BLUE
    GREEN
    BLACK
    RED

  7. #7
    Registered User
    Join Date
    05-29-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: Check if range does NOT match another range

    Quote Originally Posted by samcdavies View Post
    Thanks all, is there a way to make the same thing work, but where the initial list in is col a and the second is row 1

    ie col A contains a loa....
    I've come up with a bit of a workaround for this and it is:

    =SUMPRODUCT(--(ISNUMBER(MATCH(A1:B9,A2:A500,0))))
    where A1 is blank to allow for blank entries.

    This should always give me the answer 499 if they match. Any less and there is no match. Thanks everybody!

+ 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. check for match of cell to range of cells only if another cell is equal to X
    By rfigueroa1976 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-25-2015, 07:51 PM
  2. [SOLVED] Update INDEX/MATCH array with range check
    By x65140 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-02-2014, 07:19 AM
  3. [SOLVED] reference date time range, return the value into all cell that match datetime range
    By Jarvco13 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2013, 10:39 PM
  4. Replies: 2
    Last Post: 12-12-2012, 04:19 AM
  5. [SOLVED] Match Formula to Check if Cell Value is Within a Numeric Range Table
    By dieseldogpi in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-16-2012, 12:04 PM
  6. Excel 2007 : check date range and count another range
    By joedbug in forum Excel General
    Replies: 1
    Last Post: 02-18-2010, 01:45 PM
  7. Macro to check range, if false check another range until true, then copy
    By jayers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-12-2009, 04:19 PM

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