+ Reply to Thread
Results 1 to 10 of 10

Lookup values in 2 different workbooks.

  1. #1
    Registered User
    Join Date
    05-07-2010
    Location
    Beirut
    MS-Off Ver
    2007
    Posts
    4

    Lookup values in 2 different workbooks.

    Hi all,

    Could you please make my life more simple?

    I have 2 Excel workbooks:
    Workbook 1 has multiple worksheets that contains data like "barcode", "code", "price" and so on.
    Workbook 2 is an invoice that I receive daily and has 1 worksheet.

    For each "code" mentioned in Workbook 2, I need to lookup its "barcode" and its "price" in Workbook 1 by searching all of the woksheets in that workbook, and paste them in the same row in Workbook 2 under "Barcode" and "Price" fileds.

    Attached are examples of both workbooks

    Any help, is highly appreciated. Thnx
    Attached Files Attached Files

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

    Re: Lookup values in 2 different workbooks.

    Have a look here:

    http://www.contextures.com/xlFunctions05.html#RefWkbk

    note: that you will need to ensure the reference workbook is always open for this to work.

    If you need it closed, there exists an addin from here: http://download.cnet.com/Morefunc/30...-10423159.html that allows you to use the INDIRECT.EXT function to access closed workbooks.
    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
    Registered User
    Join Date
    05-07-2010
    Location
    Beirut
    MS-Off Ver
    2007
    Posts
    4

    Re: Lookup values in 2 different workbooks.

    Dear NBVC,

    Thank you for your help.

    I couldn't see how this formula will help me with my request!
    I was trying Vlookup. It is working fine with one worksheet as "Table_array" but I couldn't make the whole workbook (many worskeets) as this "Table _array"

    Any body knows how?

    Regards,

  4. #4
    Registered User
    Join Date
    05-07-2010
    Location
    Beirut
    MS-Off Ver
    2007
    Posts
    4

    Re: Lookup values in 2 different workbooks.

    Guys please help with the issue above.

  5. #5
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Lookup values in 2 different workbooks.

    Its a big project not just a simple fix

    what have you put to geather so far?
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  6. #6
    Registered User
    Join Date
    05-07-2010
    Location
    Beirut
    MS-Off Ver
    2007
    Posts
    4

    Re: Lookup values in 2 different workbooks.

    Nothing encouraging!
    Vlookup is working fine as long as the array is one sheet only. I could find a way to make the whole workbook 1 as my array to search.

    There must be a way to include more than one sheet.in the search

    Regards,

  7. #7
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Lookup values in 2 different workbooks.

    Hi Mostapha
    Looking at NBVC's advice have you downloaded the add-in?
    once you have the add-in you could the use if function to lookup values values on each sheet untill it find a matching value

  8. #8
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Lookup values in 2 different workbooks.

    Dude
    Yep you can use =If ( not iserror (lookup sheet1),ture=lookup sheet1 ,if (not error (lookup sheet2),lookup sheet2,if (not error (lookup sheet3),lookup sheet3
    for all your sheets

  9. #9
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Lookup values in 2 different workbooks.

    Mostapha
    you could use match to find the value then use lookup

    =IF( ISNUMBER(MATCH(B2,'[Workbook 1.xls]Earring 1'!$A:$A,0))," the lookup",IF(ISNUMBER(MATCH(B2,'[Workbook 1.xls]Necklace 2'!$A:$A,0)),"the lookup ","This code not found"))

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

    Re: Lookup values in 2 different workbooks.

    Is there any way you can include a column in Workbook2 which identifies which worksheet it is in within Workbook1... example..is it a necklace code, earring code, cufflink code, etc...

    Then you can use the INDIRECT.EXT function I mentioned at the start to link to the specific sheet and find the barcode and price.

    or even if you can create a table in your Workbook2 that identifies the first 2 characters of the codes in one column and the associate sheetname in workbook2 (it seems that the first 2 characters identifies the product type).

    e.g if you put this list say in N2:O11 of Workbook2, Sheet1

    ER Earring 1
    BT Necklace 2
    NK Necklace 4
    RG Ring 8
    BR Broosh 13
    CF Cufflinks 15
    KR Key Ring 18
    WC Watch Charm 23
    MC Mobile Charm 24
    NS Samples 00
    Then download the Morefunc.xll addin and use this formula in H2

    Please Login or Register  to view this content.
    And this formula in I2:

    Please Login or Register  to view this content.
    and copy down.
    Last edited by NBVC; 05-09-2010 at 09:56 PM.

+ 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