Relative and absolute references
References are the way that we refer to the location of a particular cell in Calc and
can be either relative (to the current cell) or absolute (a fixed amount).
Relative referencing
An example of a relative reference will illustrate the difference between a relative
reference and absolute reference using the spreadsheet from Figure 147.
1) Type the numbers 4 and 11 into cells C3 and C4 respectively of that
spreadsheet.
2) Copy the formula in cell B5 to cell C5. You can do this by using a simple copy
and paste or click and drag B5 to C5 as shown below. The formula in B5
calculates the sum of values in the two cells B3 and B4.
3) Click in cell C5. The formula bar shows =C3+C4 rather than =B3+B4 and the
value in C5 is 15, the sum of 4 and 11 which are the values in C3 and C4.
In cell B5 the references to cells B3 and B4 are relative references. This means that
Calc interprets the formula in B5, applies it to the cells in the B column, and puts the
result in the cell holding the formula. When you copied the formula to another cell,
the same procedure was used to calculate the value to put in that cell. This time the
formula in cell C5 referred to cells C3 and C4.
You can think of a relative address as a pair of offsets to the current cell. Cell B1 is 1
column to the left of Cell C5 and 4 rows above. The address could be written as R[-
1]C[-4]. In fact earlier spreadsheets allowed this notation method to be used in
formulas.
Whenever you copy this formula from cell B5 to another cell the result will always be
the sum of the two numbers taken from the two cells one and two rows above the cell
containing the formula.
Relative addressing is the default method of referring to addresses in Calc.
Chapter 7 Using Formulas and Functions 169
Comentarios a estos manuales