如何在LibreOffice Writer中对不同表中的数字求和

LibreOffice Writer can handle some of the very basic tools that are part of Calc (the LibreOffice version of Microsoft Excel) with its Table function. For example, to sum up the contents of multiple cells and place the total in a new cell, you use the exact same formula, “=sum<[cellstart]:[cellfinish]>.

LibreOffice Writer可以使用其Table函数处理Calc(Microsoft Excel的LibreOffice版本)中的某些非常基本的工具。 例如,要对多个单元格的内容求和并将总和放在一个新的单元格中,可以使用完全相同的公式“ = sum <[cellstart]:[cellfinish]>”。

But what if you’re using multiple tables, and you need to insert mathematical formulas with inputs from one table and results from another? Like, say, you have a table of sales from one quarter, and a second table with sales from another quarter, and you want to combine both of those totals in a third table? Well honestly, at this point you should probably be using Calc. But if you’d rather not, it’s an easy solution.

但是,如果您使用多个表,并且需要将数学公式与一个表的输入和另一表的结果一起插入,该怎么办? 举例来说,假设您有一个季度的销售额表,而第二个表具有另一个季度的销售额,并且您想将这两个总数合并到第三个表中? 老实说,这时您可能应该使用Calc。 但是,如果您不愿意,那么这是一个简单的解决方案。

Here’s an example of three tables in Writer. The first two tables contain sales for two separate quarters. For the third table, I want to combine the totals of the corresponding cells in the first and second table. The sum formulas in the last column will then give me the combined totals for both quarters.

这是Writer中三个表的示例。 前两个表包含两个独立季度的销售额。 对于第三张表,我要合并第一张和第二张表中相应单元格的总数。 然后,最后一列中的总和公式将为我提供两个季度的总和。

The key here is a hidden property of each table: its name. LibreOffice Writer gives each table a default name in ascending order when you insert the table. On this page, the tables are named Table1, Table2, and Table3. For the sake of example, let’s change those names to something more specific.

这里的键是每个表的隐藏属性:其名称。 当您插入表时,LibreOffice Writer会为每个表按升序提供默认名称。 在此页面上,这些表分别命名为Table1,Table2和Table3。 为了举例,让我们将这些名称更改为更具体的名称。

First, click View > Toolbars and make sure “Table” is enabled. The toolbar will be docked to the bottom of the Writer window by default.

首先,单击查看>工具栏,并确保已启用“表格”。 默认情况下,工具栏将停靠在Writer窗口的底部。

Now, click anywhere inside the first table to make it active, and then click the “Table properties” button (the one on the far right) of the toolbar.

现在,单击第一个表内的任何位置以使其处于活动状态,然后单击工具栏的“表属性”按钮(最右侧的按钮)。

In the “Table” tab, the first property is the table name. For this example, I’m going to change the names of my three tables to “FirstQ,” “SecondQ,” and “Year.” Click “OK” to apply the changes.

在“表格”标签中,第一个属性是表格名称。 对于此示例,我将把三个表的名称更改为“ FirstQ”,“ SecondQ”和“ Year”。 单击“确定”以应用更改。

Next, go down to the third table and click cell B2. We want to combine the values of the B2 cells in tables FirstQ and SecondQ.

接下来,转到第三张表,然后单击单元格B2。 我们要合并表FirstQ和SecondQ中B2单元的值。

Type “=” to start a formula. Note that the cursor jumps to the formula toolbar at the top of the page.

键入“ =”以启动公式。 请注意,光标跳到页面顶部的公式工具栏。

Now you can begin a formula just like any other, but you’ll have to use some special syntax to call on cells from other tables. For any given cell, to distinguish it as a cell from another table, type the table name, a period, and then the cell name, and put that whole thing inside angle brackets (the less than/greater than symbols). So, for example, to insert the value of the B2 cell from our FirstQ table, we’d type:

现在,您可以像其他任何公式一样开始公式,但是您必须使用一些特殊的语法来调用其他表中的单元格。 对于任何给定的单元格,要将其区别为另一个表的单元格,请键入表名,句点,然后键入单元格名称,然后将整个内容放在尖括号(小于/大于符号)中。 因此,例如,要从FirstQ表中插入B2单元格的值,请输入:

<FirstQ.B2>

With these table differentiations, you can do anything you’d do with a normal cell value. Since we want to add the B2 cell values from the first two tables together, the total formula becomes:

通过这些表的区分,您可以执行任何使用常规单元格值的操作。 由于我们想将前两个表中的B2单元格值相加,因此总公式变为:

=<FirstQ.B2>+<SecondQ.B2>

Press Enter in the formula toolbar and the formula is applied to the table, giving us the total.

在公式工具栏中按Enter键,该公式即会应用到表格中,从而得出总数。

Here, we’ve repeated this process across the entire third table, adding together the values from the various cells from the first two tables. Note that the formulas for the totals in the fifth column still work, even though those formulas (like =sum:<B2:D4>) are only being applied to the third table itself.

在这里,我们在整个第三张表中重复了此过程,将前两个表中各个单元格的值相加。 请注意,即使这些公式(例如= sum:<B2:D4>)仅应用于第三表本身,第五栏中的总计公式仍然有效。

Remember to add the table name, period, and close the value with angle brackets, and you can use pretty much any available formula while calling values from other tables. You can auto-apply the table and cell in the formula toolbar by clicking them.

记住要添加表名,句点,并用尖括号将值关闭,并且在从其他表中调用值时,几乎可以使用任何可用公式。 您可以通过在公式工具栏中单击来自动应用表格和单元格。

翻译自: https://www.howtogeek.com/343180/how-to-sum-numbers-across-different-tables-in-libreoffice-writer/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值