+ Reply to Thread
Results 1 to 3 of 3

Vlookup with dynamic named range

  1. #1
    Registered User
    Join Date
    02-10-2010
    Location
    Deep, Canada
    MS-Off Ver
    2007
    Posts
    2

    Question Vlookup with dynamic named range

    Hi,
    I have linked two spreadsheets to auto populate through Vlookup, it works fine when the both spreadsheets are open, but the link doesn't work (gives Ref#) once the spreadsheet with the dynamic named range is closed. Any idea how to fix it?

    Dynamic Named range is called: mp
    Refers to: =OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A:$A),8)

    Vlookup formula in the other sheet: =IF(ISNA(VLOOKUP(B2,'\\share\shr\updates\Spreadsheet\S2.xls'!mp,8,FALSE)),"N/A",VLOOKUP(B2,'\\share\shr\updates\Spreadsheet\S2.xls'!mp,8,FALSE))

    Let me know if I should include sample spreadsheets

    Thanks in advanced!

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

    Re: Vlookup with dynamic named range

    AFAIK the Name Ranges would need to be static I'm afraid.

    VLOOKUP isn't that inefficient so a relatively large static range shouldn't be too bad... (everything's relative though)

    It you opt for a static range then if you can sort the data by the criteria range (eg Col A) such that you can use range_lookup of 1 rather than 0 that would help significantly (meaning large ranges not necessarily a huge issue).
    (you may need to conduct a 2nd check to est. exact match but 2 tests using binary search algorithm will generally be quicker than one exact match test esp. over a large range)

    What would definitely be worthwhile is considering how to avoid double evaluation for sake of error handling.

    How best to that would largely depend on consistency of data type of the values being returned (eg always number, always text etc...)

    If there's no consistency you will find that having one matrix do the retrieval (less double evaluation) and another to do the error handling (by referencing the first) will speed things up as there's only ever one trip to the target file.


    I guess other workarounds could include using VBA and the BeforeClose event to modify the RefersTo such that it becomes static based on data at the point of closure and subsequently use the Open event to reinstate the Dynamic RefersTo ... and so on and so forth ... but that's quite a lot of work (obviously)...

  3. #3
    Registered User
    Join Date
    02-10-2010
    Location
    Deep, Canada
    MS-Off Ver
    2007
    Posts
    2

    Re: Vlookup with dynamic named range

    ya...., that sounds complicated, lol. I just extended the named range for extra 500 rows because there are relatively few new entries entered.
    Thanks anyways for the reply DonkeyOte!!
    Last edited by basketball; 02-22-2010 at 12:47 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