+ Reply to Thread
Results 1 to 7 of 7

Simple formula to check if a value appears in a different worksheet column

  1. #1
    Registered User
    Join Date
    04-16-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    90

    Simple formula to check if a value appears in a different worksheet column

    In this scenario there are two lists of customers, some of the customers will exist on both. I want to use a simple formula to identify those customers and return TRUE if they do, FALSE if they don't. Currently, I would do this by using a combination of NOT + ISERROR + XMATCH, but I want to be able to show this to some of my colleagues and was wondering if there was a shorter formula that would do the same thing. The formula I use can be seen in the rows highlighted in yellow.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,370

    Re: Simple formula to check if a value appears in a different worksheet column

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,370

    Re: Simple formula to check if a value appears in a different worksheet column

    Or:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-16-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    90

    Re: Simple formula to check if a value appears in a different worksheet column

    Thank you so much. I love this, especially that it works with text as well as numbers. I also tried it with alphanumeric and it worked as well. Also saw that it works by changing it to =COUNTIF(Sheet2!B:B,B2)=1, which would probably be easier to explain that =COUNTIF(Sheet2!B:B,B2)>0.

    Can you tell me what the >0 is doing here? Does it mean that 0 represents no matches and 1 represents a match?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,370

    Re: Simple formula to check if a value appears in a different worksheet column

    You're welcome. Thanks for the rep.

    If you just use =COUNTIF(Sheet2!B:B,B2), you get a count of matching records. So, if there is a single match, you get 1. If there is no match, you get 0. =COUNTIF(Sheet2!B:B,B2)>0 will return TRUE or FALSE, rather than 1 or 0.

    If there is MORE than 1 match in that list, =COUNTIF(Sheet2!B:B,B2)>0 will still return TRUE. However, =COUNTIF(Sheet2!B:B,B2)=1 will return FALSE. Up to you . I am biased, but I would stick with =COUNTIF(Sheet2!B:B,B2)>0 . . . just in case there is any inadvertent duplication.

    Does it mean that 0 represents no matches and 1 represents a match?
    So, not quite. 0 represents no match. Greater than 0 ( >0 ), represents one or more matches.

  6. #6
    Registered User
    Join Date
    04-16-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    90

    Re: Simple formula to check if a value appears in a different worksheet column

    That makes sense. Thank you.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,370

    Re: Simple formula to check if a value appears in a different worksheet column

    You're welcome.

    And, another option is
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    So, here the COUNTIF()=0 means there is no match. Conversely, NOT(COUNTIF()=0) means there IS a match.

    You have different ways to explain it. Hopefully, one will stick.

+ 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. [SOLVED] Formula to see if a value appears more than once in a column
    By walrus_22 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-29-2021, 11:58 PM
  2. [SOLVED] Who knows how to check if a cell appears in another sheet? FORMULA
    By bryanblsd in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-11-2018, 02:27 PM
  3. [SOLVED] A simple formula to check text in a cell?
    By Ginjarou in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-07-2017, 11:40 AM
  4. Match a value and check if it appears within a table and shade if it appears
    By khanaran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2017, 10:19 AM
  5. Execute formula if certain text appears in another column
    By qhoney in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-15-2014, 01:06 PM
  6. Formula for value in a column that appears in the highest row number
    By Matt Chis in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-20-2011, 11:33 PM
  7. simple mathmatics worksheet with answer check
    By Shocked in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-05-2008, 05:50 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