Direcciones y referencias, absolutas y relativas

Referencias a celdas

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.

Intervalos de celdas

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.

Por ejemplo, .

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 referencia

Estos operadores devuelven un intervalo de cero, una o más celdas.

El intervalo tiene la mayor precedencia, seguido de la intersección y, por último, la unión.

Operador

Nombre

Ejemplo

:

Intervalo

A1:C108, A:D or 3:13

!

Intersección

SUMA(A1:B6!B5:C12)

En este ejemplo B5 y B6 están en la intersección y se calcula su suma.

~

Concatenación o unión

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.


Referencia relativa

A1 hace referencia a la celda en la columna A y fila 1. La referencia a un área contigua se consigue indicando la esquina superior izquierda del área, luego dos puntos y finalmente la celda inferior derecha del área. El área cuadrada de las primeras cuatro celdas en la esquina superior izquierda se llamaría de este modo A1:B2.

En esta forma de referencia a un área, la referencia a A1:B2 será una referencia relativa. Relativa significa en este contexto que la referencia se ajusta al área al copiar las fórmulas.

Referencia absoluta

En oposición a las referencias relativas existen las referencias absolutas que se escriben de la siguiente forma: $A$1:$B$2. Delante de cada dato usado como absoluto deberá figurar el signo del dólar.

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 le muestra de manera esquemática las referencias a una fórmula. Si pulsa p.ej. en una celda sobre la fórmula =SUMA(A1:C5;D15:D24), ambas áreas referenciadas se destacarán en color. La parte de la fórmula «A1:C5» puede, p. ej., aparecer en azul, y el intervalo de celdas referenciado en el mismo tono de azul. La siguiente parte de la fórmula, «D15:D24» puede aparecer marcada de forma semejante en rojo.

¿Cuándo usar referencias relativas y cuándo absolutas?

¿Cómo se distingue una referencia relativa? Supongamos que desea calcular en la celda E1 la suma de las celdas en el área A1:B2. La fórmula que debe introducir en E1 debe ser: =SUMA(A1:B2). Si más tarde decide insertar una columna nueva delante de la columna A, los elementos que quiere sumar aparecerán entonces en B1:C2 y la fórmula en F1, en lugar de en E1. Por consiguiente, tras insertar la nueva columna, debería comprobar y corregir todas las fórmulas de la hoja, y posiblemente en otras hojas.

Afortunadamente, LibreOffice se encarga de ello. Después de insertar una nueva columna A, la fórmula =SUMA(A1:B2) se actualiza a =SUMA(B1:C2) de forma automática. Los números de fila también se ajustan automáticamente al insertar una nueva fila 1. Las referencias absolutas y relativas se ajustan en LibreOffice Calc siempre que se desplaza el área a la que se hace referencia. Tenga cuidado, no obstante, al copiar una fórmula, ya que en ese caso únicamente se ajustan las referencias relativas, no las absolutas.

Las referencias absolutas se utilizan cuando un cálculo hace referencia a una celda específica de la hoja. Si una fórmula que hace referencia precisamente a esa celda se copia a una celda situada más abajo que la original, la referencia se desplazará hacia abajo si no se han definido las coordenadas como absolutas.

Aparte de con la inserción de nuevas filas y columnas, las referencias también pueden cambiar si una fórmula que hace referencia a celdas específicas se copia en otra área de la hoja. Suponiendo que ha introducido la fórmula =SUMA(A1:A9) en la fila 10, si desea calcular la suma de la columna adyacente a la derecha, solo tiene que copiar esta fórmula en la celda de la derecha. La copia de la fórmula en la columna B se ajustará automáticamente para obtener =SUMA(B1:B9).

¡Necesitamos su ayuda!