+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP between workbooks, don't return results matching a 2nd column criteria?

Hybrid View

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    Europe
    MS-Off Ver
    Excel 2013/365
    Posts
    24

    VLOOKUP between workbooks, don't return results matching a 2nd column criteria?

    Hi,

    As part of a procedure I'm writing there will be an exact match check between two separate workbooks of data, e.g. Book1 and Book2.

    Basically the goal is to see if any of the values entered in "Column A" in Book1 exist in Book2 "Column A" and return those. A simple VLOOKUP would suffice here except there is data I don't want returned as "matched" in Book2 that are marked to be excluded in a "Column B". Duplicate matches are ok.

    E.g.

    Book1:

    Column A
    Value1
    Value2
    Value3
    Value4
    Value4


    Book2:

    Column A Column B
    Value1
    Value2 Exclude
    Value3
    Value4
    Value4

    I'm looking for a solution that would in this example case return Value1, Value3, Value4 as matches but not Value2, is that possible with a formula?

    E.g.

    Book1 (with result):

    Column A Column B(vlookup)
    Value1 Value1
    Value2 #N/A
    Value3 Value3
    Value4 Value4
    Value4 Value4
    Last edited by Tunesmith; 12-09-2014 at 11:59 AM. Reason: Solved

  2. #2
    Forum Contributor
    Join Date
    01-30-2013
    Location
    Wales
    MS-Off Ver
    Excel 2013
    Posts
    231

    Re: VLOOKUP between workbooks, don't return results matching a 2nd column criteria?

    Set your lookup range to include Column B. Lookup Value in column A return column2 and if it says "Exclude" then "#N/A" otherwise vlookup value and use column1.

    Does this make sense to you?
    Click * below if this answer helped

  3. #3
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: VLOOKUP between workbooks, don't return results matching a 2nd column criteria?

    Try something like this..

    Formula: copy to clipboard
    =IF(VLOOKUP($A2,Sheet2!$A$2:$B$6,2,0)="Exclude",NA(),IFERROR(VLOOKUP($A2,Sheet2!$A$2:$B$6,1,0),"Actually NA()"))


    Change the range of sheet 2 accordingly..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  4. #4
    Registered User
    Join Date
    08-02-2012
    Location
    Europe
    MS-Off Ver
    Excel 2013/365
    Posts
    24

    Re: VLOOKUP between workbooks, don't return results matching a 2nd column criteria?

    Hello,

    I'd like to apologize for the delayed response, this got put on the back burner for a bit.

    The formula Debraj posted appears to suit my needs perfectly, I've tested it in my sandbox and it works as I've intended. Thank you!

+ 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. Replies: 13
    Last Post: 06-18-2014, 08:14 PM
  2. [SOLVED] Return cell values for non-matching & matching criteria
    By jenz_skallemose in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-13-2012, 11:52 AM
  3. [SOLVED] Look up value and return all matching results
    By strudel in forum Excel General
    Replies: 7
    Last Post: 08-22-2012, 11:34 AM
  4. Replies: 2
    Last Post: 06-12-2012, 06:39 PM
  5. vlookup, how return the matching value to 2 column?
    By s_zabihi in forum Excel General
    Replies: 1
    Last Post: 12-01-2011, 04:18 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