+ Reply to Thread
Results 1 to 12 of 12

How to get rid of #Ref! errors when formula refers to external workbooks

  1. #1
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    How to get rid of #Ref! errors when formula refers to external workbooks

    I have a vlookup function linked to a Table in an external workbook. But when the external workbook is closed the formulas result in #Ref! errors.

    How do i overcome this problem. I am linking my vlookup to table to make the range dynamic as my external workbook table data keeps on growing.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    =IFERROR(Your_formula,"")

    should do that.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    I am looking to find a way to update the values while the workbook is closed.

    Your suggestion is good when the external link is not dynamic.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    Ah.. Unfortunately, dynamic named ranges do not work on closed workbooks.

  5. #5
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    Its not a names range, but a Table. So you mean it doesn't make any difference if its a named range or a table the result is same ???

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    Is it necessary for the external reference to be dynamic in size? I would try a fixed reference that is larger than the source lookup table will ever be. If I know I will never have more than 100 records in the source, use [book]sheet!$A$1:$F$100 for the lookup table reference.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    Yes my source lookup table is being populated on a daily basis and keeps growing.

    I can easily fix a larger range as you suggested into my vlookup function but it drastically slows down the calculation process as my excel destination file has large data running over half a million rows at any given time.

    Anyhow thanks for your input.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    Can you show the formula/s you are having problems with?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  9. #9
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    I have the following vlookup in 6 different columns across over 625000 rows:

    =VLOOKUP(B625370,'D:\Imran\SQL Reports\Imran\AllAnalysisMaster.xlsm'!dTable_Stores_Geo_Master[#Data],2,0)
    =VLOOKUP(B625370,'D:\Imran\SQL Reports\Imran\AllAnalysisMaster.xlsm'!dTable_Stores_Geo_Master[#Data],3,0)
    =VLOOKUP(B625370,'D:\Imran\SQL Reports\Imran\AllAnalysisMaster.xlsm'!dTable_Stores_Geo_Master[#Data],4,0)
    =VLOOKUP(B625370,'D:\Imran\SQL Reports\Imran\AllAnalysisMaster.xlsm'!dTable_Stores_Geo_Master[#Data],9,0)
    =VLOOKUP(D625370,'D:\Imran\SQL Reports\Imran\AllAnalysisMaster.xlsm'!dState[#Data],3,0)
    =VLOOKUP(D625370,'D:\Imran\SQL Reports\Imran\AllAnalysisMaster.xlsm'!dState[#Data],5,0)

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    I suspect that you are pushing the limits of Excel... You will already have thought of this... but can't you do the lookups in AllAnalysisMaster.xlsm

  11. #11
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    I don't know how much of a time penalty is associated with accessing a closed workbook. I note that your formulas are using linear "exact match" searches (4th argument=0 or FALSE), and I know there is a severe time penalty for linear searches. A third observation -- you have 4 functions performing the same lookup (which row contains the value in B625370) and 2 functions performing the "which row contains the value in D625370". Working backwards:

    1) Reduce or eliminate duplicated effort by replacing those 6 lookups with 2 lookups. You perform the 2 lookups with MATCH() functions (in helper cells), then use INDEX() to return each needed field from the found row. See this discussion for details: https://www.excelforum.com/excel-for...ows-excel.html

    2) By any means necessary, sort the lookup table so you can use a binary search. If I had 0.5E6 rows to search through, I think it would take threats to job, family, life, national security, or similar to convince me to use a linear search. The time/performance penalty associated with linear searches is so great with large data sets that I would do all I could to make this a binary search. Note that, if "exact match" is important, it will almost certainly be faster to perform 2 binary searches than 1 linear search. (=IF(B625370=VLOOKUP(...,TRUE),VLOOKUP(...,TRUE),NA()) will be faster than the current formulas).

    I created a pair of simple worksheets to test (lookup file contained a full column 1E6 rows of data. working file contained ~450 copies of a random lookup on this column of data). Testing results:
    search type -- lookup file state -- calculation time
    linear -- closed -- ~10 seconds
    linear -- open -- ~5 seconds
    binary -- closed -- near instantaneous
    binary -- open -- instantaneous

    Based on the limited information you have provided, I would try those strategies and see if performance improves enough to be workable.

  12. #12
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: How to get rid of #Ref! errors when formula refers to external workbooks

    Thank you so much. i will try out your suggestion.

+ 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. how to tell which rows a formula refers to
    By zazzz in forum Excel General
    Replies: 7
    Last Post: 07-01-2014, 05:57 PM
  2. Replies: 3
    Last Post: 04-19-2013, 03:38 PM
  3. Forumla which refers to a cell which refers to a sheet name
    By awiller2 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-03-2012, 09:57 PM
  4. formula for showing cell data from multiple external workbooks
    By sandy.beach in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-05-2009, 08:13 PM
  5. External Web Query Errors
    By tokyo4tokyo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-24-2006, 11:20 PM
  6. [SOLVED] vlookup- refers to the range within the external file
    By Mike McLellan in forum Excel General
    Replies: 6
    Last Post: 04-28-2006, 04:35 PM
  7. [SOLVED] Cell has a value of #N/A when the formula refers to nothing
    By Man Utd in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-16-2005, 05:05 PM

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