+ Reply to Thread
Results 1 to 7 of 7

Check if ALL Row Values Exist In Another Column

  1. #1
    Registered User
    Join Date
    08-23-2011
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    57

    Check if ALL Row Values Exist In Another Column

    If I want to check if the value in a single cell (for example: E5) can also be found in a column of cells (for example: the named range "match_list"), I believe I can do this with either of the following two formulas:

    =NOT(ISERROR(MATCH(E5,match_list,0)))
    =IF(ISNA(VLOOKUP(E5,match_list,1,FALSE)),"FALSE","TRUE")

    But is there a way to check to see if every value in a range of cells (for example: E5:AR5) can be found in the "match_list" range? So it would be FALSE if any one of the values in E5-AR5 can't be found in the match_list range, and it would be TRUE only if every one can be found in the match_list range?

    Thanks!

  2. #2
    Registered User
    Join Date
    08-23-2011
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    57

    Re: Check if ALL Row Values Exist In Another Column

    I'm not sure if it's the most elegant formula in the world, but this seems to work for me:

    =SUMPRODUCT(--(ISNA(MATCH(E5:AR5,match_list2,0))))=COLUMNS(E5:AR5)

  3. #3
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Check if ALL Row Values Exist In Another Column

    Another possibility:

    =SUM(--ISERROR(MATCH(E5:AR5,match_list,0)))=0

    This is an array formula. Commit using CTRL-SHIFT-ENTER

  4. #4
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Check if ALL Row Values Exist In Another Column

    And another possibility similar to the above but a regular (not an array) formula:

    =SUMPRODUCT(--ISERROR(MATCH(E5:AR5,match_list,0)))=0

  5. #5
    Registered User
    Join Date
    08-23-2011
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    57

    Re: Check if ALL Row Values Exist In Another Column

    Thank you! I ultimately went with mine. I don’t know if it’s any better or worse, but it’s ever so slightly shorter 😊. I had to modify it a bit though (as best as I know how), because the formula seemed to break down if any of the cells in the E5:AR5 range were left blank (which they often will be).

    I ultimately went with this:
    =SUMPRODUCT(--(ISNA(MATCH(E5:AR5,match_list,0))))=0+COUNTBLANK(E5:AR5)

    This also works:
    =SUMPRODUCT(--ISERROR(MATCH(E5:AR5,match_list,0)))=0+COUNTBLANK(E5:AR5)

    Thanks again. I will mark the thread as solved.

  6. #6
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Check if ALL Row Values Exist In Another Column

    So if it's a competition for shortest then I have (dealing with blanks):
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Or, if you add zero to the match list, then that takes care of blanks and any of the above (shorter) formulas will work without further change.

    Sorry - couldn't resist

  7. #7
    Registered User
    Join Date
    08-23-2011
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    57

    Re: Check if ALL Row Values Exist In Another Column

    Well now you just crushed me… I’m switching to that

    (Can’t simply add the zero because I’m not the only one who will edit the match list data.)

+ 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] Check if other strings exist in column based on range string values
    By jeroenft in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-12-2018, 11:47 AM
  2. [SOLVED] Check if other strings exist in column based on range string values
    By jeroenft in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-12-2018, 07:49 AM
  3. [SOLVED] Formula to check if any decimal exist in the range of values
    By Masa1989 in forum Excel General
    Replies: 3
    Last Post: 07-27-2015, 03:56 AM
  4. Replies: 4
    Last Post: 03-04-2012, 08:34 AM
  5. Check if Column Exist
    By izet99 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-21-2009, 02:43 PM
  6. [SOLVED] Check if a value exist in a column
    By DJ Steffo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-30-2006, 10:40 AM
  7. check exist of filenames in column, mark red if missing
    By PROTMAN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2006, 12:25 AM

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