Replicate data from separate files in OpenOffice Calc

2

I have several .ods files full of data (say data1.ods, data2.ods etc). These files use exactly the same format, so that calculations based on data1.ods would be equally relevant on data from data2.ods. I have another calc file (say main.ods) where I make calculations. In main.ods, I currently have calculations using exclusively cells from data1.ods. I would like now to be able to easily change main.ods so that the data used comes from data2.ods instead, or any other file (calculations remaining the same).

I could do a replace all and replace 'file:///C:/Users/jean__000/Desktop/data1.ods' with 'file:///C:/Users/jean__000/Desktop/data2.ods' when needed, but this feels dirty, and will not work well when I am using data from several files. Instead, I would like to enter the name of the file to be used in a cell, and change this name whenever needed.

For example, cell A1 of Sheet1 in main.ods I could type ="'file:///C:/Users/jean__000/Desktop/data1.ods'#Sheet1", and change the name (or filepath) here when needed. However, I do not manage to use this. If I want to read column B of Sheet1 of data1.ods in column B of Sheet1 in main.ods, I can type in cell B1 =INDIRECT(ADRESSE(1;2;4;1;$A$1)). However, I cannot "drag" that formula to copy the rest of column B.

Note: I am using French version of Calc, hence the "ADRESSE" instead of "ADDRESS".

Jean

Posted 2016-03-02T11:42:18.620

Reputation: 23

Answers

1

Set cell A1 to 'file:///C:/Users/jean__000/Desktop/data1.ods'#$Sheet1 without an equals sign or double quotes. In cell B1, enter the formula =INDIRECT($A$1 & "." & ADRESSE(ROW(),COLUMN())).

Now drag and drop to your heart's content. :)

Documentation for ROW() is at https://wiki.openoffice.org/wiki/Documentation/How_Tos/Calc:_ROW_function.

Jim K

Posted 2016-03-02T11:42:18.620

Reputation: 2 601

1This works (with a semicolon instead of a comma, ADRESSE(LIGNE();COLONNE()). Thanks a lot! – Jean – 2016-03-07T11:12:40.650

Follow-up question: I now have a list of files (say in cells A1, ..., A9) like your cell A1, and in cells B1, ... , B9 I have a boolean representing whether I want the corresponding files to be included in the calculations or not. I now want to compute the sum, over all files which are set to TRUE, of a given cell (say, C1). If this was just a sum across sheets I could use a sumprod of indirect of the given range, but I can't find how to designate a range across different files. – Jean – 2016-03-07T15:21:04.403

Go ahead and ask this as a separate question, with a link to this question in case people need more information. If it's tagged with openoffice-calc then I'll see it. – Jim K – 2016-03-07T21:48:10.190

Turned into a new question: http://superuser.com/questions/1049900/sum-over-cells-across-different-files

– Jean – 2016-03-07T22:39:13.647