LibreOffice 25.2 帮助
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.
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.
A1表示的是位于列A行1处的单元格。要描述一个单元格区域,只要在给出这个单元格区域左上角处的单元格位置后输入双引号,随后给出这个单元格区域右下角处的单元格位置即可。比如: 由工作表左上角处的四个单元格所组成的单元格区域可以命名为A1:B2。
这种描述单元格区域的方式(A1:B2)是一个相对引用。在复制公式时,您必须对借助相对引用描述的单元格区域重新进行配置。
与相对引用相反,绝对引用上述单元格区域的表达方式是:「$A$1:$B$2」。也就是说在每个单元格坐标说明之前需插入一个美元符号。
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 还能够高亮显示对公式中数据的引用。比如按击单元格中的公式「=SUM(A1:C5;D15:D24)」后,工作表中这两个被引用的区域就会用颜色高亮显示。公式中的「A1:C5」部分显示为蓝色,工作表中的这个区域也以蓝色框表示;公式中的「D15:D24」显示为红色,相应地工作表中的这个区域则以红色框表示。
相对引用有什么不同呢?假设您想在单元格 E1 中计算 A1:B2 区域中的单元格总和。输入 E1 的公式为: =SUM(A1:B2)。如果后来您又决定在 A 列前插入一个新列,要添加的元素在 B1:C2 中,公式在 F1 中,而不是在 E1 中。插入新列之后,您必须检查和更正该工作表或其他工作表中的所有公式。
幸运的是,LibreOffice 会替您完成此任务。插入新列 A 后,公式 =SUM(A1:B2) 将自动更新为 =SUM(B1:C2)。插入新行 1 时,行号也会自动调整。只要移动了引用区域,LibreOffice Calc 中的绝对引用和相对引用就会进行相应的调整。但是请注意,复制公式时只调整相对引用,而不会调整绝对引用。
当要引用工作表中的某一个单元格进行计算时,请使用绝对引用。如果您没有将单元格设定为绝对引用,那么,当将引用了此单元格的公式复制到源单元格下方的单元格中时,引用的单元格也将跟着下移。
除了插入新的行或列,将引用了特定单元格的现有公式复制到同一工作表的另一个区域中时,也会更改引用的单元格。假定您在第 10 行中输入了公式 =SUM(A1:A9)。如果要计算右边相邻列的总和,只需将此公式复制到右边的单元格中。复制到列 B 中的公式将自动改为 =SUM(B1:B9)。