Native INDIRECT functions in Excel - work on one computer, but return #REF to another

It's quite complicated, but I will do my best to explain it as clearly as possible. Please let me know if this makes no sense.

I have two books - entry and exit. They must be separate because of how the system works, i.e. The Nominee makes all the input into a simple tutorial for input, and the formatted workbook makes it ready to use. For this to work, the exit workbook must reference the input workbook to get the values.

I tested this by opening both workbooks.

For this, I use the nested functions INDIRECT ; the first creates a path to the file, calling the named range, and the second tells Excel to interpret this path to the file and retrieve the value.

I start using INDIRECT to create a file path:

 =INDIRECT("input_sheet_location")&"Wk 25 2012'!$B$11" 

This returns something like:

 \\My Documents\Subfolder\[input_sheet.xlsx]Wk 25 2012'!$B$11 

And then paste it into another to force Excel to read this path:

 =INDIRECT("'"&INDIRECT("input_sheet_location")&"Wk 25 2012'!$B$12") 

This successfully returns the value of cell B12 from input_sheet_location - the named range that is the file directory. For the argument, we can say that it returns:

 Captain America underpants 

So it works great. For me. However, it does not work on another user's computer. I tried to dig and developed the following:

  • The connection between files is also present on their systems - a study of Data> Edit Links shows that they have the same working connection, like me.
  • A file path occurs; I built a macro to show it to the user, and on three machines it exits the same every time.
  • Most importantly (and vaguely), the non-nested INDIRECT formula works. This is only a nested formula that only works on my computer. The error #REF returned on every other user's computer.

Can anyone understand why this could be so? I'm at a loss.

Thanks for reading this page.

+7
source share
2 answers

You said that the first Indirect Formula + Concatenation returns a value similar to:

 \\My Documents\Subfolder\[input_sheet.xlsx]Wk 25 2012'!$B$11 

The sheet name should not have one quote on each side and return a value similar to:

 \\My Documents\Subfolder\[input_sheet.xlsx]'Wk 25 2012'!$B$11 

I noticed that your second formula has a single quote for the sheet name in front of the file path.

Instead, try the following two formulas:

 =INDIRECT("input_sheet_location")&"'Wk 25 2012'!$B$11" 

and / or

 =INDIRECT(INDIRECT("input_sheet_location")&"'Wk 25 2012'!$B$12") 

Let me know if they will work for you.

+2
source

may be a dumb question, but does it really work?

= INDIRECT ("input_sheet_location") & "Wk 25 2012"! $ B $ 11 "

don't the brackets at the end of _Location close the indirect function? must not be

= INDIRECT ("input_sheet_location" & "Wk 25 2012"! $ B $ 11 ")

At least the only way this works for me is to have it all the way in the parenthesis of indirect functions.

0
source

All Articles