Written by Allen Wyatt (last updated March 20, 2020)
This tip applies to Excel 2007, 2010, 2013, and 2016
Kirk noted that if he copies a cell referencing a cell in an external workbook, he gets an error. However, if that external workbook is open when he does the very same steps, he does not get an error message. Kirk wonders why this occurs.
There could be a variety of reasons for this happening. The most probable is that for whatever reason the information that it must get from the external sheet is unavailable or cannot be located.
Another possible reason is that your formula could be an INDIRECT link or the workbook could have been opened and the links not updated. If the formula is complex, Excel requires that the external workbook be open. (Microsoft has never provided a clue as to what constitutes "complex" in this case. Basically, if you get an error, the formula is "complex.")
In general, you could consider a formula complex if it does a calculation on the external data to get a result, such as with MATCH, LOOKUP, etc. An example would be storing a month number in workbook A and using that value to calculate year-to-date costs from monthly data stored in individual cells in workbook B. (In other words, you use the month number as an index to access the information in workbook B.)
A workaround for some (but not all) situations is to do the complex calculations completely in workbook B with workbook B linking to workbook A to get the data needed for that calculation. Retrieving the month number from workbook A is not complex and can be easily done by Excel. You could then open workbook A and have it read the result of the calculation from workbook B.
Most of the time, it's best if you can avoid cross-referencing cells between workbooks. If that's not an option, then constructing a macro to open and close all of the required workbooks is the best way to go.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11683) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Errors when Copying References to External Cells.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
Got some numbers and letters mixed up in the same cell? You may need to get rid of those letters so you are left with ...
Discover MoreWhen you undo actions within Excel, those steps you undo may affect the multiple workbooks in which you've been working. ...
Discover MoreNeed to enter the current time into a cell? It's easy to do using this keyboard shortcut. The shortcut is a handy one to ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2017-06-23 17:36:01
Dennis Costello
There are 4 functions that are particularly prone to causing this problem that you might not expect: CountIF, CountIFS, SumIF and SumIFS. SUM and COUNT generally do not. INDIRECT and OFFSET do. Match and xLOOKUP generally do not.
All of the above applies in this situation, which is a little different than was posed above:
- you open workbook A
- you open workbook B, and put into it references to workbook A using any of the functions mentioned above.
- close both workbooks
- come back later and open workbook B but not workbook A: Where you expect numbers, you get #VALUE!.
I use the COUNTIFS and SUMIFS functions a lot in what I do, and across workbooks. As Allen implied, I figured out I needed to put these functions into the same workbook as the cells to which they refer (workbook A in my case study above), and then in the referring workbook (B in my case), put in "hard links" to those cells in workbook A. Apparently, Excel caches in the cells in workbook B the last value it saw for those hard links if workbook A is not open when you open workbook B, and updates them if you subsequently open A while B is still open (that's why open a workbook triggers a recalc cycle).
As to why this caching doesn't work for a handful of functions, I can't say.
2016-07-10 19:55:17
Mark Fitzgerald
Formulas containing references to named ranges or structured references to tables in the linked workbook will return #REF! errors if the linked workbook isn't open. Replacing those references with range addresses will often work even if the linked workbook is closed.
2016-07-07 02:59:32
Yann
I had this kind of problem when updating my On-Time-Delivery indicators. I finally found another solution.
If you create an array formula to get your data from the external workbook, whatever complex the array formula is, then you do not need the external file to be opened anymore. The errors that appeared before are turned into the desired result.
2016-07-05 02:51:45
Chris
Philip
I thought workspaces were no longer available in the "new" excel?
2016-07-03 05:50:38
Uche Uche
Just to say thanks for your excellent works and selfless assistance to us all who are students of excel, could you please add one method, guideline of how one can create a micro. Thanks
2016-07-03 04:11:08
Philip
Even better than constructing a macro to open and close all of the required workbooks, is saving the set of workbooks as a workspace ...
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2023 Sharon Parq Associates, Inc.
Comments