+ Reply to Thread
Results 1 to 4 of 4

Comparing multiple columns of two lists

  1. #1
    Registered User
    Join Date
    09-21-2012
    Location
    Norway
    MS-Off Ver
    MS Office Professional Plus 2010
    Posts
    2

    Comparing multiple columns of two lists

    Hey,

    I have two workbooks of approximately 26 000 and 13 000 rows. In the first workbook (WB1) each row contains an ID number in column "B", and a document number in column "L". In the second workbook (WB2) column "A" contains a document number, and column "I" an ID number. In column "O" a text, i.e. "Verified" is displayed.

    Both ID and document numbers contain both letters and numbers, i.e. "12-3A-BC-D45-678" or "AB1234".


    What I need done, is the following:

    I want to add a column "P" to WB1. When the "B" and "L" values of a row in WB1 is found in the "I" and "A" columns of any row in WB2, cell "P_" should display "Verified" (the text will be in Norwegian, but all cells in "P" should give either "text" or no value.)

    Example:

    Capture.PNG


    I don't know much visual basics, and have just tried working something out using =IF():

    =IF(AND(B6=$U$6:$U$13451;L6=$T$6:$T$13451);"Verified";"")

    (I copied columns A and I from WB2 into U and T, WB1)


    However, the result seems to be either an empty cell or "#VALUE!". I don't know how to resolve this, and I also suspect that my formula does not demand that the values from B and L, WB1 needs to be found in the same row in WB2.


    I would very much appreciate it if anyone has a solution to my problem! Please let me know if the problem is not expressed clearly enough. Btw, I use MS Office Professional Plus 2010.

    Regards,
    oyvron
    Last edited by oyvron; 09-21-2012 at 11:38 AM.

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Comparing multiple columns of two lists

    Try this instead and then fill down in column P.
    The $ sign means an absolute reference, I don't think that's what you want here.
    By removing the $ the references in the formula it will change as you copy it down the column and will always refer to the cells on the same row (relative references).
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Also, this code here is referred to as a formula since it resides in a cell. The visual basic stuff looks different and resides behind the scenes in Excel.

  3. #3
    Registered User
    Join Date
    09-21-2012
    Location
    Norway
    MS-Off Ver
    MS Office Professional Plus 2010
    Posts
    2

    Re: Comparing multiple columns of two lists

    First of all, thank you for replying so fast!

    I guess I didn't express the VBA-part clearly... I meant that because I don't know much VBA, I have just tried to figure something out using formulas/functions

    Regarding, the $ sign, I don't think I could remove it. I have used it (or tried to, anyways) to define ranges ($U$6:$U$13451 and $T$6:$T$13451), and those ranges should be the same for each row. The two cells of each row in WB1 needs to be cross checked for against every row in WB2. The match, if existing, won't necessarily be found on the same row.

    Also, since the number of rows is different, I would eventually cross check against empty cells.

    Does this make sense?

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Comparing multiple columns of two lists

    It will if you post a sample workbook. For the record I'm not a good reader.

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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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