+ Reply to Thread
Results 1 to 12 of 12

Vlookup across mulitple sheets

  1. #1
    Registered User
    Join Date
    09-29-2014
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    8

    Question Vlookup across mulitple sheets

    Afternoon,

    I'm trying to use a Vlookup to look if a number appears in the same single column (D) across 88 worksheets. I'm then hiding this cell and using a conditional format in the adjacent cell with an =IF(O4>0,"Y") to let me know the value has been found. I'm sure this isn't the most efficient way to do this, but I can't figure out another way.

    If I use:

    =IFERROR(VLOOKUP(J4,'Smith, John'!D2:D101,1,FALSE),IFERROR(VLOOKUP(J4,'Smith2, John'!D2:D101,1,FALSE),IFERROR(VLOOKUP(J4,'Smith3, John'!D2:D101,1,FALSE),IFERROR(VLOOKUP(J4,'Smith4, John'!D2:D101,1,FALSE),IFERROR(VLOOKUP(J4,'Smith5, John'!D2:D101,1,FALSE),IFERROR(VLOOKUP(J4,'Smith6, John'!D2:D101,1,FALSE),"")))))) it works fine, but I can only have the 64 nested if statements, so I'll run out.

    I've tried several variations of creating an array on the same worksheet "MySheets" and listing the range, but I get a ?Name error.
    =VLOOKUP(B1,INDIRECT("'"&INDEX(MySheets,MATCH(1,--(COUNTIF(INDIRECT("'"&MySheets&"'!D2:D101"),J4)>0),0))&"'!D2:D101"),1,False)

    Any tips? I'm stumped.

  2. #2
    Registered User
    Join Date
    09-29-2013
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Vlookup across mulitple sheets

    Can you post an example in here?, my first thought is using Countif

  3. #3
    Registered User
    Join Date
    09-29-2014
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    8

    Re: Vlookup across mulitple sheets

    Lookup_Value: H4 (an 8 digit number, that will never be duplicated anywhere in the workbook)
    Table_Array: Only Column D of: 'Smith1, John' 'Smith2, John' 'Smith3, John' etc for 88 total sheets
    Col_index_num: 1 (I think, it's the only column I need)
    Range_lookup: False so it finds an exact

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlookup across mulitple sheets

    are they your exact sheet names?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Vlookup across mulitple sheets

    Control+shift+enter, not just enter:
    Please Login or Register  to view this content.
    This would return B1 if B1 is available, provided that MySheets lists all of the relevant sheets and the sheet names are all text.

  6. #6
    Registered User
    Join Date
    09-29-2014
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    8

    Re: Vlookup across mulitple sheets

    Quote Originally Posted by martindwilson View Post
    are they your exact sheet names?
    Not exactly, the real sheets names are real people's names.

  7. #7
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Vlookup across mulitple sheets

    Quote Originally Posted by suarezri View Post
    Not exactly, the real sheets names are real people's names.
    See post #5...

  8. #8
    Registered User
    Join Date
    09-29-2014
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    8

    Re: Vlookup across mulitple sheets

    Quote Originally Posted by Aladin Akyurek View Post
    Control+shift+enter, not just enter:
    Please Login or Register  to view this content.
    This would return B1 if B1 is available, provided that MySheets lists all of the relevant sheets and the sheet names are all text.
    When I use this:

    =VLOOKUP(I4,INDIRECT("'"&LOOKUP(REPT("z",255),IF(COUNTIF(INDIRECT("'"&MySheets&"'!D2:D101"),I4),MySheets))&"'!D2:D101"),1,0) I'm still getting a #NAME? in the cell. I have all of the sheets off to the side (that will be hidden) listed under a cell listed MySheets, is this the correct manner?

    When I show the calculation steps it shows the evaluation shows the 255 z's...

  9. #9
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Vlookup across mulitple sheets

    You need to create a range which houses all of the relevant sheets one by one. When done, select this range and name the selection MySheets using the Name Box. That will take care of the #NAME? error...

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlookup across mulitple sheets

    works fine for me are you sure there are no gaps in the formula?
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    09-29-2014
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    8

    Re: Vlookup across mulitple sheets

    I found my error, I didn't name my range of sheets. It works perfectly now!

  12. #12
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Vlookup across mulitple sheets

    Quote Originally Posted by suarezri View Post
    I found my error, I didn't name my range of sheets. It works perfectly now!
    Great to hear it's sorted out.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Need macro to run on mulitple sheets
    By robschr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2014, 12:14 PM
  2. Combining Mulitple Sheets into one but it does it twice
    By bernice620 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2012, 03:19 PM
  3. [SOLVED] gather data from mulitple sheets
    By Qppg in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-10-2012, 02:48 PM
  4. VBA code to write to mulitple tab sheets
    By mal.b.graham in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-11-2011, 10:36 AM
  5. Pivot Table with Mulitple Sheets
    By Jerry.Peoples in forum Excel General
    Replies: 0
    Last Post: 04-20-2010, 10:26 AM

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