Calc - avoiding circular references

Ubuntu 13.04 > LibreOffice > Calc 4.0.2.2
I'm a veteran Excel-er, but very new to Calc.
I've had to invent some syntax in the following question - hope you can follow it.

In Excel, to set up a row of column headings (years say), you would do:
A1 => 1965 [Enter]
B1:AX1 => formula(=A1+1) [Control+Enter]

and B1 would become set to 1966, ... , AX1 would become set to 2013.
What is the equivalent syntax in Calc?

If I try:
A1 => 1965 [Enter]
B1:AX1 => array formula(=(A1:AW1)+1) [Control+Shift+Enter]

B1 is calculated correctly, but the other cells get Err:522 - circular reference,
which I agree it is in a way, but in Excel this doesn't matter
as the looping through the list is done left to right, so it isn't really circular.

This is such basic stuff that it doesn't seem to be documented.

Dave

Ubuntu 13.04 > LibreOffice > Calc 4.0.2.2
I'm a veteran Excel-er, but very new to Calc. I've had to invent some syntax in the following question - hope you can follow it.

In Excel, to set up a row of column headings (years say), you would do:
A1 => 1965 [Enter]
B1:AX1 => formula(=A1+1) [Control+Enter]

and B1 would become set to 1966, ... , AX1 would become set to 2013.
What is the equivalent syntax in Calc?

I don't know of one.

If I try:
A1 => 1965 [Enter]
B1:AX1 => array formula(=(A1:AW1)+1) [Control+Shift+Enter]

B1 is calculated correctly, but the other cells get Err:522 - circular reference, which I agree it is in a way, but in Excel this doesn't matter as the looping through the list is done left to right, so it isn't really circular.

This is different, as you are creating an array, not a list of separate, interdependent formulae - though that apparently works in Excel too.

Possible workarounds:

o In A1, enter 1965. Drag the fill handle along to AX1 (which I make 2014, by the way).

o In A1, enter 1965. In B1, enter =A1+1. Copy B1 and paste into C1:AX1 (or into B1:AX1 if easier).

o In A1:AX1, enter =1964+COLUMN() [Ctrl+Shift+Enter].

o Select row A. Go to Edit | Fill > | Series... . Choose Right for Direction and Linear for Series type. Enter 1965 for Start value, 2014 for End value, and 1 for Increment. OK. (No need to know in advance where the list will end.)

Note that one of these processes leaves you with separate formulae, one with an array, and two with separate values. This may make a difference if you later need to change anything.

I trust this helps.

Brian Barker

Ubuntu 13.04 > LibreOffice > Calc 4.0.2.2
I'm a veteran Excel-er, but very new to Calc.
I've had to invent some syntax in the following question - hope you can
follow it.

In Excel, to set up a row of column headings (years say), you would do:
A1 => 1965 [Enter]
B1:AX1 => formula(=A1+1) [Control+Enter]

and B1 would become set to 1966, ... , AX1 would become set to 2013.
What is the equivalent syntax in Calc?

If I try:
A1 => 1965 [Enter]
B1:AX1 => array formula(=(A1:AW1)+1) [Control+Shift+Enter]

B1 is calculated correctly, but the other cells get Err:522 - circular
reference,
which I agree it is in a way, but in Excel this doesn't matter
as the looping through the list is done left to right, so it isn't
really circular.

This is such basic stuff that it doesn't seem to be documented.

Dave

A common possible method in Calc would be:
A1 => 1965 [Enter]
B1 => formula(=A1+1) [Enter]
B1 => copy
C1:AX1 => paste

So, more steps than in Excel; simpler than an array formula.

I don't remember whether there is a simple keyboard shortcut to
simultaneously insert the same value/formula in multiple cells in
Calc.

Best Regards,
Ady.

I don't remember whether there is a simple keyboard shortcut to
simultaneously insert the same value/formula in multiple cells in
Calc.

I'd like to clarify the above paragraph. One thing would be to insert
"the same" value/formula simultaneously in multiple cells. A more
powerful keyboard shortcut would be to:

1_ Select a range of cells;
2_ Type in a formula;
3_ Press a combination of keys that would:
3.1_ insert the typed in value/formula in the first cell of the
selected range, and then;
3.2_ would "extend", or "fill in", or "copy+paste" the first cell to
the rest of the cells in the selected range.

If the typed in formula would be "=A1+1" (without quotation marks),
then:
A_ the "same formula" would mean the _exact_ same formula, as if it
would be copying the content of the cell (as oppose to copying the
first "cell"; or
B_ copying the first formula while respecting relative references too
(e.g. "=A2+1" ; "=A3+1"; ... )

Whether case "B" would also copy the entire first cell (including
formatting) into the rest of the selected range would be something to
consider if/when such shortcut gets to be considered for development
in Calc.

Regards,
Ady.

Hi Dave,

Dave Kimble schrieb:

Ubuntu 13.04 > LibreOffice > Calc 4.0.2.2
I'm a veteran Excel-er, but very new to Calc.
I've had to invent some syntax in the following question - hope you can
follow it.

In Excel, to set up a row of column headings (years say), you would do:
A1 => 1965 [Enter]
B1:AX1 => formula(=A1+1) [Control+Enter]

and B1 would become set to 1966, ... , AX1 would become set to 2013.
What is the equivalent syntax in Calc?

You need to mark the range B1:AX1 in a way, that B1 is your active cell. You can do it by dragging back from AX1 to B1, or while B1 is active write the range B1:AX1 into the name field (leftmost from the input line) and hit Enter.
Then click into the input line and write =A1+1 and finalize input with ALT+Enter.

For small ranges I use the simple drag copying that was already mentioned here. For large ranges, sometimes more than 10000 rows, I use the way to mark a range via the name field.

Kind regards
Regina

>
> I don't remember whether there is a simple keyboard shortcut to
> simultaneously insert the same value/formula in multiple cells in
> Calc.

I'd like to clarify the above paragraph. One thing would be to insert
"the same" value/formula simultaneously in multiple cells. A more
powerful keyboard shortcut would be to:

1_ Select a range of cells;
2_ Type in a formula;
3_ Press a combination of keys that would:
3.1_ insert the typed in value/formula in the first cell of the
selected range, and then;
3.2_ would "extend", or "fill in", or "copy+paste" the first cell to
the rest of the cells in the selected range.

If the typed in formula would be "=A1+1" (without quotation marks),
then:
A_ the "same formula" would mean the _exact_ same formula, as if it
would be copying the content of the cell (as oppose to copying the
first "cell"; or
B_ copying the first formula while respecting relative references too
(e.g. "=A2+1" ; "=A3+1"; ... )

Whether case "B" would also copy the entire first cell (including
formatting) into the rest of the selected range would be something to
consider if/when such shortcut gets to be considered for development
in Calc.

And that shortcut is [alt]+[enter], as Regina mentioned (thanks) in a
prior email in this topic thread.

From the useful:

[url]
https://help.libreoffice.org/Calc/Shortcut_Keys_for_Spreadsheets
[/url]

[quote]
To fill a selected cell range with the formula that you entered on
the Input line, press Alt+Enter.
[/quote]

So instead of:

A1 => 1965 [Enter]
B1:AX1 => formula(=A1+1) [Control+Enter]

in Calc you do:

A1 => 1965 [Enter]
B1:AX1 => formula(=A1+1) [Alt+Enter]

BTW, there is a _very limited_ document regarding LibreOffice and
MSOffice (including Calc and Excel):

[url]
https://wiki.documentfoundation.org/Feature_Comparison:LibreOffice-_
Microsoft_Office [/url]

Regards,
Ady.