Context: I have large calc (.ods) text-data files, that needs some basic processing (text-processing, sums, sums-if,…), and I want to separate the files holding the data from the file holding the processing.
In the “process” calc file, I enter the considered filename, say in A1 I write “my_file.ods”, and I want to use that as a reference for all the processing.
Now, in another cell, I want to fetch the data from a given cell in that file.
If I do that manually, I end up with a cell holding the following string:
=‘file:///mnt/sda2/some/path/my_file.ods’#$ABC.F2
The cell will now hold the content of cell F2 from sheet ABC from file “my _file.ods”.
Note: I notice that if I enter manually the string
=‘file:my_file.ods’#$ABC.F2
it gets automatically converted to the above string (absolute path), but it does correctly return the cell value.
Problem:
Now I want to use the file name defined in a cell. This sounds like a usecase for the INDIRECT()
function:
Entering in A2 the following function:
=CONCATENATE("‘file:";A1;"’#ABC.F2")
produce the string
‘file:my_file.ods’#$ABC.F2
which is exactly the same as the string above (with the exception of the ‘=’ sign) !
But if I enter in cell A3 the string =INDIRECT(A2)
, I get an error: #REF!
What did I miss here ?
Edit See also the help website has a page about this.