+ Reply to Thread
Results 1 to 6 of 6

matching columns based on specific criteria

  1. #1
    Forum Contributor
    Join Date
    11-09-2008
    Location
    Washington State
    MS-Off Ver
    2007
    Posts
    164

    matching columns based on specific criteria

    I am attaching a sample worksheet. Sheet 1 has a list of 'parcel numbers' in Column A. I need the appropriate street address for every parcel in Column A. On sheet 2 I have a master list of parcel numbers with their respective street addresses.The parcel numbers on Sheet 1 are mixed into the list on column 2 however my 'real' list has about 2000 on sheet 1 which comes from a list of about 10,000 on sheet 2 which is too much to do by hand. I am hoping for a macro to place the appropriate address from sheet 2 next to the parcel number on sheet 1.

    Many thanks.
    Attached Files Attached Files
    Last edited by abuchan; 06-30-2010 at 06:16 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: matching columns based on specific criteria

    Try this formula in Column B:

    =IF(ISNUMBER(MATCH(TRIM(A1),Sheet2!A:A,0)),VLOOKUP(TRIM(A1),Sheet2!A:B,2,0),"")

    copied down.


    you will get blanks if code doesn't exist
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    11-09-2008
    Location
    Washington State
    MS-Off Ver
    2007
    Posts
    164

    Re: matching columns based on specific criteria

    Thank you for your quick response. I tried it and it gave me the first street number and stopped. Could that be because the street address on Sheet 2 is in columns B, C, D, and E?

    Thank you again.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: matching columns based on specific criteria

    I thought you only wanted column B...

    Try in B1:

    =IF(ISNUMBER(MATCH(TRIM($A1),Sheet2!$A:$A,0)),VLOOKUP(TRIM($A1),Sheet2!$A:$E,COLUMNS($A$1:B$1),0),"")

    copied across and down.

    Note: You have a blank column C in your example.

  5. #5
    Forum Contributor
    Join Date
    11-09-2008
    Location
    Washington State
    MS-Off Ver
    2007
    Posts
    164

    Re: matching columns based on specific criteria

    My errorr regarding column C. It is used for street direction and the sample I chose didn't include any. I can't seem to get past the first street number. I must be doing something incorrect but can't figure what. I will continue trying, thank you.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: matching columns based on specific criteria

    Here's your workbook with my formula included...
    Attached Files Attached Files

+ 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