+ Reply to Thread
Results 1 to 5 of 5

comparing two different columns and copy field from 3rd column

  1. #1
    Registered User
    Join Date
    05-11-2011
    Location
    Pasadena, CA
    MS-Off Ver
    Excel 2007
    Posts
    2

    comparing two different columns and copy field from 3rd column

    I have tried using vlookup for this but it is not returning the currect field. I have two different excel files. I need to compare phone numbers from one column in file 1 to all of the different worksheets column C in file 2. If file 2 has the same phone number from file 1, then copy the entry from column L on that row to column F in file 1.

    More clarification:

    File 1:
    Compare all phone numbers in column A to column C in all worksheets in File 2.

    File 2:
    If a matching phone number is found from column A in file 1 and any column C in file 2, then copy the number in column L on the same matching row from file 2 into the same matching row of the original phone number in file 1 into column F.

    Let me know if there is a function that will do this or if you need more clarification.

    Thanks!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: comparing two different columns and copy field from 3rd column

    bkl99,

    This should work:
    Please Login or Register  to view this content.


    Notes:
    -Formula goes in column L of each worksheet
    -Update the C:\Test Folder to be the location of the workbook that contains the phone numbers
    -Update Phone Number.xls to be the name of the workbook that contains the phone numbers
    -Update Sheet1 to be the name of the sheet that contains the phone numbers
    -Update the $A$2:$F$10 to be the range that contains the phone number to lookup and the corresponding row in F to return. Keep the $ symbols.

    Hope that helps,
    ~tigeravatar

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: comparing two different columns and copy field from 3rd column

    bkl99,

    Or are you trying to go the other direction? Compare the File1 to each worksheet in File2 and return the result from File2, column L for each worksheet?

    ~tigeravatar

  4. #4
    Registered User
    Join Date
    05-11-2011
    Location
    Pasadena, CA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: comparing two different columns and copy field from 3rd column

    tigeravatar,

    yes, i am comparing column A in file1 to all column C's in file2, then copying the result in column L of file2 back into column F in file1.

    i tried using this formula but it returns "N/A". columns A and C are sorted and they do have column headers (if that matters)
    =VLOOKUP(A:A,'[TU_FO61500_10 - 032011.xls]61500-6911'!$L:$L,'[TU_FO61500_10 - 032011.xls]61500-6911'!$C:$C,FALSE)

    is there something i can specify instead of worksheet "61500-6911" that will search all worksheets in file "TU_FO61500_10 - 032011.xls"?

    thanks for your help!
    Last edited by bkl99; 05-12-2011 at 11:47 AM.

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: comparing two different columns and copy field from 3rd column

    bkl99,

    You can use this macro to accomplish what you're looking for. Some notes about the macro:
    • It requires that only File1 be open, viewing the worksheet with the phone numbers you want to look for in column A
    • When you run the macro, you will be prompted to open a workbook. The workbook that should be opened is File2

    Here's the code
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

+ 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