I have cells in a few rows that all reference one row on another sheet:
=Sheet2.A1
=Sheet2.B1
=Sheet2.C1
When I select these cells and drag the fill handle to fill the cells below, Calc fills them like this:
=Sheet2.A4
=Sheet2.B4
=Sheet2.C4
=Sheet2.A7
=Sheet2.B7
=Sheet2.C7
etc.
I guess it's doing this because each new row is three cells below the original row.
This is not the behaviour I want - I want to fill them in a series, like this:
=Sheet2.A2
=Sheet2.B2
=Sheet2.C2
=Sheet2.A3
=Sheet2.B3
=Sheet2.C3
=Sheet2.A4
=Sheet2.B4
=Sheet2.C4
etc.
Any ideas how to do this?
I'd like to use either a formula or a manual way of doing this - I'm not familiar with macros so would rather avoid if possible, please.
Manual way (I like that suggestion, I never even thought about using Calc to automatize the process of filling in spreadsheet formulas before, but it's doable):
- Open a new Calc file
- Format cell A1 as text
- type =Sheet2. into A1 (A1 should now display =Sheet2. literally)
- type A B C into B1, B2 and B3 respectively
- select B1 to B3 and drag down (it should repeat series A,B,C,A,B,C...)
- type =FLOOR((ROW()-1)/3)+2 into C1 (ROW() starts counting from 1 hence the -1)
- drag that down (it should give you the series 2,2,2,3,3,3,4,4,4...)
- type =A$1&B1&C1 into D1 (D1 should now display =Sheet2.A2 literally)
- drag D1 down and it should give you your desired series
- NOW: copy that
- paste it into any notepad or similar plain text editor
- copy that
- paste it into the Calc spreadsheet you wanted to have this series of references in first place
- it should open a text import dialogue - just make sure everything is pasted into one column and hit OK
Voilà
- pros: when your colleagues see you do that you will be seen as LibreOffice god from now on
- cons: not very dynamic (you'll have to repeat the whole process if something changes)
Formula way:
Use OFFSET.
E.g: =OFFSET(Sheet2.$A$2;FLOOR((ROW()-1)/3);MOD(ROW()-1;3))
- pros: easier to modify
- cons: if the results are not what you're expecting, it's harder to debug