+ Reply to Thread
Results 1 to 7 of 7

Vlookup

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Vlookup

    I have a spreadsheet with account numbers in it, and then I have an "updated" spreadsheet with account numbers in it. Is it possible to use the Vlookup to compare these two spreadsheets (but only the column on Spreadsheet1 and Spreadsheet2 that contain the accounts) and find if there are duplicate account numbers?

    F.Y.I. --- I found a way to do it, I just want to know if there is a way to use Vlookup to do it. If you can not do it using Vlookup, I am interested in other options, such as a VBA code also.

  2. #2
    Registered User
    Join Date
    10-05-2010
    Location
    S.A
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Vlookup

    try this code:
    =IF(ISNA(VLOOKUP(Sheet1!A:A,Sheet2!$A$1:$B$5,2,FALSE)),"","Duplicate")
    supposing your data in sheet1&2

  3. #3
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Vlookup

    Quote Originally Posted by noexcel=badwork View Post
    try this code:
    =IF(ISNA(VLOOKUP(Sheet1!A:A,Sheet2!$A$1:$B$5,2,FALSE)),"","Duplicate")
    Just so I am understanding this correctly, the Sheet1 is the sheet where the data is, the A:A is saying to look in all rows of column A?? then again Sheet2 is the sheet where the data I want to compare is, and the $A$1:$B$5$ is the locations in Sheet2 that I am wanting to Compare. What are the 2, False and ""? And I am assuming that "Duplicate" is there because if they are duplicates this is the word that will populate?

  4. #4
    Registered User
    Join Date
    10-05-2010
    Location
    S.A
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Vlookup

    yes, for 2 it stands for column number in sheet2 (in our example it is empty)
    as for false: it compares entries and bring back the exact match
    if it is true it will bring the approximate match
    finally, (""), instead of #N/A coming, by this way, the cell will be empty
    if conditions not applied.

  5. #5
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Vlookup

    Quote Originally Posted by noexcel=badwork View Post
    yes, for 2 it stands for column number in sheet2 (in our example it is empty)
    And column 2, we mean "B" correct?

    finally, (""), instead of #N/A coming, by this way, the cell will be empty
    if conditions not applied.
    Could I change what is between the "", and make it read more like

    =IF(ISNA(VLOOKUP(Sheet1!A:A,Sheet2!$A$1:$B$5,2,FALSE)),"No","Yes")
    And this will have Excel display, No if it is not a duplicate, and Yes if it is a duplicate?

  6. #6
    Registered User
    Join Date
    10-05-2010
    Location
    S.A
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Vlookup

    sorry if I could not explain well
    but here I attached a sample of what
    you need
    I changed it to show "no" or "yes
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Vlookup

    Another simpler and probably more efficient approach using lesser functions In B1 enter
    =IF(COUNTIF(Sheet2!$A$1:$A$5,Sheet1!A1),"yes","no")
    and pull down as neeeded

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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