+ Reply to Thread
Results 1 to 7 of 7

comparing a set of coloumns in excel ( VLOOKUP not working)

  1. #1
    Registered User
    Join Date
    05-18-2014
    MS-Off Ver
    Excel 2003
    Posts
    3

    comparing a set of coloumns in excel ( VLOOKUP not working)

    Hello everyone. I have been breaking my head with this problem since morning and I haven't found a solution. Please give your valuable pointers if possible, so that I can try to find the solution.

    I basically have two sets of data- an old list and a new list. I wish to compare the new list( comparing name and country together) with an old list, since the new list has a few additional entries. Later on, I would like to create a new list with common entries from both old and new list and add all the new entries below the common ones ( if possible, else I will do that manually later on but I would like Excel to tell me that this is a new entry). Sorry, if this has not been well explained, but maybe the following screenshot helps.

    As can be seen in this attachment, I have an old list with Item No., Name and Country. Let's assume that the item numbers have been classified based on some code words. In the second list, there are again Item No.s, Name and Country but some item numbers haven't been filled ( since they are new and have not yet been sorted). Now, I want Excel to compare the names AND countries of both data and provide the common Item No. output if there is a match. If there is no match, then I would like Excel to tell me that this is a new entry. I looked up on various forums and I realized that VLOOKUP command only allows me to search on Name OR Country would give me the common entries of Names/Countries respectively but not Item No.s. Please look at the desired output in the attachment.
    Excel_Comparison.png

    Please let me know if there are other formulas that I can use for such an output. Thanks in advance for your help.

  2. #2
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: comparing a set of coloumns in excel ( VLOOKUP not working)

    You can use VLOOKUP, but the trick is to concatenate the Name and Country first.
    In both lists create an additional column and join Name and Country IE: Name&Country (no need for spaces.)
    Then use VLOOKUP: =VLOOKUP(Name&Country,Table_Array,Col_Index_No,False)

    BTW: I could provide better assistance if you attach a sample file to illustrate on. I don't want to type out data from a picture.
    Regards,
    Rudi

  3. #3
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: comparing a set of coloumns in excel ( VLOOKUP not working)

    Here is the solution, it's not perfect but does the job :-)
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-18-2014
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: comparing a set of coloumns in excel ( VLOOKUP not working)

    Quote Originally Posted by Amik555 View Post
    Here is the solution, it's not perfect but does the job :-)
    Thank you Amik555 and RudiS for answering my question. This solution works fine for this sample data. Unfortunately, my original data has a lot more coloumns in between for eg. Item No., Name, Wholesale Price, Retail Price, Profit, Country etc and it is possible that the name and country might be similar between old data and new data but the wholesale price, retail price, profit maybe different. I assume that this approach might not work since we cannot sort the data properly anymore. Sorry, if the additional coloumsn should have been explained before.

  5. #5
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: comparing a set of coloumns in excel ( VLOOKUP not working)

    @hermes I would suggest you to please attach a mock of sample which clearly describes your problem and expected answers so best solution can be tailored.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  6. #6
    Registered User
    Join Date
    05-18-2014
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: comparing a set of coloumns in excel ( VLOOKUP not working)

    Please see this attachment for the sample data. ( sorry, I did not know how to attach an Excel sheet, therefore, I took a screenshot).
    Excel_Comparison_Revised.png

  7. #7
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: comparing a set of coloumns in excel ( VLOOKUP not working)

    assuming your old list is in A1 to F11 and New list is in J3 to N12
    in B17 copy paste below
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then hold control shift and Enter together and then hit enter to make it array formula drag down until you get blank

    Now copy paste the same formula in C17 and change Red Part to $K$3:$K$12 hold control and shift together and then hit enter to make it array formula drag down until you get blank.

    Now copy paste the same formula in D17 and change Red Part to $N$3:$N$12 hold control and shift together and then hit enter to make it array formula drag down until you get blank

    Change the references according to your actual data set.

+ 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. VBA code to consolidate coloumns in muliple sheets into multiple coloumns in one sheet?
    By BrettRCourtney in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2013, 09:17 AM
  2. [SOLVED] VBA code to consolidate coloumns in muliple sheets into multiple coloumns in one sheet?
    By BrettRCourtney in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-13-2013, 06:19 AM
  3. Excel 2007 : Comparing 2 Coloumns
    By UselessMan in forum Excel General
    Replies: 0
    Last Post: 09-23-2011, 04:24 PM
  4. Vlookup with two coloumns
    By niladri20005 in forum Excel General
    Replies: 2
    Last Post: 07-18-2011, 02:07 AM
  5. [SOLVED] Comparing two coloumns text contents & extract different values
    By nabil in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2006, 09:30 PM

Tags for this Thread

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