添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
地址和引用,绝对和相对

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, .

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).

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.

A1表示的是位于列A行1处的单元格。要描述一个单元格区域,只要在给出这个单元格区域左上角处的单元格位置后输入双引号,随后给出这个单元格区域右下角处的单元格位置即可。比如: 由工作表左上角处的四个单元格所组成的单元格区域可以命名为A1:B2。

这种描述单元格区域的方式(A1:B2)是一个相对引用。在复制公式时,您必须对借助相对引用描述的单元格区域重新进行配置。

与相对引用相反,绝对引用上述单元格区域的表达方式是:「$A$1:$B$2」。也就是说在每个单元格坐标说明之前需插入一个美元符号。

将光标移至输入行内后按「F4」键,LibreOffice 能够将当前输入行中的引用在相对引用和绝对引用之间转换。如果是相对引用,例如 A1,第一次按下组合键后,行与列都将被设置为绝对引用 ($A$1)。再次按下组合键后,只有列 (A$1) 被转换,第三次按下组合键,只有行 ($A1) 被转换。如果再次按下该组合键,行和列都被转换成相对引用 (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)。

Help content debug info:

This page is: /text/scalc/guide/relativ_absolut_ref.xhp

Title is: 地址和引用,绝对和相对