+ Reply to Thread
Results 1 to 6 of 6

matching rows from two tables

  1. #1
    Registered User
    Join Date
    05-27-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Unhappy matching rows from two tables

    Hello!

    Is there anyone able to help me with this problem?
    I have two tables with about 900 rows. Both the tables have the same first column (names of groundwater wells), but they are differently organized and not possible to align in the same manner (alphabetically, etc...) because the names contain letters and numbers. In the second column of the second table I have another identification of these wells (11 digit numbers) which I want to transfer to the first table (the right number to the right well).
    Could anyone help me to find the very match in the two tables to get the right codes to their wells? I could get the three columns of interest to the same sheet of course - I just need to organize the wells' names and codes from the second table in the same way as I have the names in the first table.

    Thanks for consideration!!

    k

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: matching rows from two tables

    can you uplaod an example?

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: matching rows from two tables

    Take a look at the VLOOKUP function in XL Help, ie assuming:

    Table1: Sheet1 Column A

    Table2: Sheet2 Columns A & B

    Sheet1
    B1: =VLOOKUP(A1,Sheet2!A:B,2,0)
    copied down

    would retrieve the value from Column B on sheet2 where the value in Column A on Sheet2 equalled the value of A1 on Sheet1.

  4. #4
    Registered User
    Join Date
    05-27-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: matching rows from two tables

    Thanks for Your time!

    There You go with the example.
    Simply: column A = few wells I want to add the ID to; column C = all my wells & their ID in column D.

    How to automatically assign the right ID to the wells in the OBJECT (column A)?

    Thanks again!

    k
    Attached Files Attached Files

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: matching rows from two tables

    Adapting the earlier VLOOKUP example

    B2: =VLOOKUP(A2,C:D,2,0)
    copied down

    Note: where the Well does not exist in Column C you will get an #N/A
    You can handle this using:

    =IF(ISNA(MATCH(A2,C:C,0)),"n/a",VLOOKUP(A2,C:D,2,0))

    change "n/a" to be whatever you want to appear where the value in A is not found in C

  6. #6
    Registered User
    Join Date
    05-27-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: matching rows from two tables

    IT WORKS!
    Thank You very much for the help!

    k

+ 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