Enderezos e referencias, absolutos e relativos

Cell references

An individual cell is fully identified by the sheet it belongs, the column identifier (letter) located along the top of the columns and a row identifier (number) found along the left-hand side of the spreadsheet. On spreadsheets read from left to right, the complete reference for the upper left cell of the sheet is Sheet.A1.

Cell ranges

You can reference a set of cells by referencing them in ranges. Ranges can be a block of cells, entire set of columns and entire set of rows. The range A1:B2 is the first four cells in the upper left corner of the sheet. Range A:E contains all the cells of column A, B, C, D and E. Range 2:5 contains all the cells of row 2, 3, 4 and 5.

A referencia a unha cela ou a outro documento contén o nome completamente cualificado do outro documento entre aspas simples (') seguido dun cancelo #, do nome da folla do outro documento, seguido dun punto e do nome ou referencia á cela.

Por exemplo, .

note

O URI da ruta e o nome do documento deben sempre estar entre aspas simples. Se o nome contén aspas simples (') hainas que escapar mediante dúas aspas simples (''). O nome dunha folla só pode ir sen aspas se non contén un espazo ou un carácter que funcione como operador ou se o nome é puramente numérico (por exemplo, «123» debe ir entre aspas).


Operadores de referencia

These operators return a cell range of zero, one or more cells.

Range has the highest precedence, then intersection, and then finally union.

Operador

Nome

Example

:

Intervalo

A1:C108, A:D or 3:13

!

Intersección

SUM(A1:B6!B5:C12)

Calculates the sum of all cells in the intersection; in this example, the result yields the sum of cells B5 and B6.

~

Concatenation or union

Takes two references and returns a reference list, which is a concatenation of the left reference followed by the right reference. Double entries are referenced twice.

=COUNT(A1:B2~B2:C3) counts values of A1:B2 and B2:C3. Note that the cell B2 is counted twice.

=INDEX(A1:B2~C1:D2;2;1;2) selects cell C2, that is, the first cell of the second row, first column, of the second range (C1:D2) of the range list.


note

A reference list is not allowed inside an array expression.


Enderezos relativos

The cell in column A, row 1 is addressed as A1. You can address a range of adjacent cells by first entering the coordinates of the upper left cell of the area, then a colon followed by the coordinates of the lower right cell. For example, the square formed by the first four cells in the upper left corner is addressed as A1:B2.

Ao referirse a unha área deste xeito, estase a facer unha referencia relativa a A1:B2. Relativo aquí significa que a referencia a esta área se axusta automaticamente ao copiar as fórmulas.

Referencias absolutas

As referencias absolutas son o contrario ás referencias relativas. Colócase un símbolo de dólar antes de cada letra e número dunha referenica absoluta, por exemplo, $A$1:$B$2.

tip

LibreOffice can convert the current reference, in which the cursor is positioned in the input line, from relative to absolute and vice versa by pressing F4. If you start with a relative address such as A1, the first time you press this key combination, both row and column are set to absolute references ($A$1). The second time, only the row (A$1), and the third time, only the column ($A1). If you press the key combination once more, both column and row references are switched back to relative (A1)


LibreOffice Calc shows the references to a formula. If, for example, you click the formula =SUM(A1:C5;D15:D24) in a cell, the two referenced areas in the sheet will be highlighted in color. For example, the formula component "A1:C5" may be in blue and the cell range in question bordered in the same shade of blue. The next formula component "D15:D24" can be marked in red in the same way.

When to Use Relative and Absolute References

What distinguishes a relative reference? Assume you want to calculate in cell E1 the sum of the cells in range A1:B2. The formula to enter into E1 would be: =SUM(A1:B2). If you later decide to insert a new column in front of column A, the elements you want to add would then be in B1:C2 and the formula would be in F1, not in E1. After inserting the new column, you would therefore have to check and correct all formulas in the sheet, and possibly in other sheets.

Fortunately, LibreOffice does this work for you. After having inserted a new column A, the formula =SUM(A1:B2) will be automatically updated to =SUM(B1:C2). Row numbers will also be automatically adjusted when a new row 1 is inserted. Absolute and relative references are always adjusted in LibreOffice Calc whenever the referenced area is moved. But be careful if you are copying a formula since in that case only the relative references will be adjusted, not the absolute references.

Absolute references are used when a calculation refers to one specific cell in your sheet. If a formula that refers to exactly this cell is copied relatively to a cell below the original cell, the reference will also be moved down if you did not define the cell coordinates as absolute.

Aside from when new rows and columns are inserted, references can also change when an existing formula referring to particular cells is copied to another area of the sheet. Assume you entered the formula =SUM(A1:A9) in row 10. If you want to calculate the sum for the adjacent column to the right, simply copy this formula to the cell to the right. The copy of the formula in column B will be automatically adjusted to =SUM(B1:B9).

Precisamos da súa axuda!