Endereços e referências, 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.

The reference to a cell of another document contains the fully qualified name of the other document between single quotes ('), then a hash #, then the name of the sheet of the other document, followed by a period and the name or reference of the cell.

For example, .

note

The path and document name URI must always be enclosed in single quotes. If the name contains single quotes (') they must be escaped using two single quotes (''). Only a sheet name may not be quoted if it does not contain a space or a character that would be an operator or the name would be pure numeric (for example, '123' must be quoted).


Operadores de referências

Estes operadores devolvem um intervalo de células de zero, uma ou mais células.

O intervalo tem a maior precedência, em seguida, interseção e, por último, união.

Operador

Nome

Example

:

Intervalo

A1:C108, A:D or 3:13

!

Interseção

SOMA(A1:B6!B5:C12)

Calcula a soma de todas as células na interseção. Neste exemplo, o resultado devolve a soma das células B5 e B6.

~

Concatenação ou união

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.


Endereços relativos

A célula na coluna A, linha 1 é referenciada como A1. Pode referenciar-se um intervalo de células adjacentes introduzindo em primeiro lugar as coordenadas da célula do canto superior esquerdo da área, introduzindo dois pontos e, em seguida, as coordenadas da célula inferior direita. Por exemplo, o retângulo formado pelas primeiras quatro células no canto superior esquerdo é referenciado como A1:B1.

Ao referenciar uma área desta forma, está a efetuar uma referência relativa a A1: B2. Neste contexto, a palavra relativa significa que a referência a esta área será automaticamente ajustada quando copiar as fórmulas.

Endereços absolutos

As referências absolutas são o oposto às referências relativas. Insere-se o sinal dólar antes de cada letra e número nas referências absolutas, 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)


O LibreOffice Calc mostra as referências a uma fórmula. Se, por exemplo, clicar na fórmula =SOMA(A1:C5;D15:D24) numa célula, as duas áreas referenciadas na folha de cálculo serão realçadas com cor. Por exemplo, o componente da fórmula "A1:C5" pode estar a azul e o intervalo da célula em questão com as margens sombreadas a azul. O componente seguinte da fórmula "D15:D24" pode estar marcado a vermelho de forma semelhante.

Quando utilizar referências relativas e absolutas

O que distingue uma referência relativa? Suponha que pretende calcular na célula E1 a soma das células no intervalo A1:B2. A fórmula que introduzirá em E1 será: =SOMA(A1:B2). Se decidir inserir posteriormente uma nova coluna à frente da coluna A, os elementos que pretende adicionar estariam em B1:C2 e a fórmula seria introduzida em F1 e não em E1. Após ter inserido a nova coluna, teria de verificar e corrigir todas as fórmulas na folha de cálculo e, possivelmente, em todas as restantes folhas.

Felizmente, o LibreOffice executa esta tarefa por si. Após ter inserido a nova coluna A, a fórmula =SOMA(A1:B2) será automaticamente atualizada para =SOMA(B1:C2). Os números das linhas serão também automaticamente atualizados quando uma nova linha 1 é inserida. As referências absolutas e relativas são sempre ajustadas no LibreOffice Calc quando a área referenciada é movida. Contudo, proceda com cautela quando copiar uma fórmula uma vez que, nesse caso, só as referências relativas serão ajustadas e não as referências absolutas.

As referências absolutas são utilizadas quando um cálculo se refere a uma célula específica na folha de cálculo. Se uma fórmula que se refere precisamente a esta célula for copiada relativamente para a célula inferior à original, a referência será igualmente movida se as coordenadas da célula não forem definidas como absolutas.

Para além do momento em que se inserem novas linhas e colunas, as referências podem ser alteradas quando uma fórmula referente a células específicas for copiada para outra área da folha de cálculo. Introduziu hipoteticamente a fórmula =SOMA(A1:A9) na linha 10. Se pretender calcular a soma da coluna adjacente da direita, simplesmente copie esta fórmula para a célula à direita. A cópia da fórmula na coluna B será automaticamente ajustada a =SOMA(B1:B9).

Necessitamos da sua ajuda!