公式

打开子菜单,可以从中选择公式并插入到表格的单元格中。将光标置于希望显示结果的表格单元格或文档的某个位置上。点击「公式」图标并从子菜单中选择要使用的公式。

公式将显示在输入行中。要指定表格单元格区域,请使用鼠标选择所需的单元格。对应的单元格引用也会显示在输入行中。根据需要输入其他参数,并点击「应用以确认输入的条目。如果您知道相应的语法,也可以直接输入公式。这是必要的,例如,在插入字段和「编辑字段」对话框中。

要访问此命令...

Go to Table - Edit Formula.

In the Table toolbar, press the Insert or Edit Formula icon.

In a text document, press F2.

Formula icon in Table toolbar

公式


公式选项摘要

基本计算函数

Operation

Name

Example

加法

+

计算总和。

示例: <A1> + 8

减法

-

Calculates the difference.

示例: 10 - <B5>

乘法

MUL 或 *

计算乘积。

Example: 7 MUL 9 displays 63

除法

DIV或/

Calculates the quotient.

Example: 100 DIV 15 displays 6.67


子菜单中的基本函数

Function

Name

Example

求和

SUM

计算选中单元格的总和。

示例: SUM <A2:C2> 显示单元格 A2 到 C2 中数值总和

取整

ROUND

将数字取整到指定数位。

示例: 15.678 ROUND 2 显示为 15.68

百分比

PHD

Calculates a percentage.

示例: 10 + 15 PHD 的结果显示为 10.15

平方根

SQRT

计算平方根。

Example: SQRT 25 displays 5

POW

计算数字的幂。

Example: 2 POW 8 displays 256


运算符

You can insert various operators in your formula. Choose from the following functions:

Operator

Name

Example

列表分隔符

|

将元素分隔为列表。

使用列表的示例:

MIN 10|20|50|<C6>|<A2:B6>|20

等于

EQ 或 ==

检查选中值是否相等。如果不相等,结果为零,否则为 1 (真)。

Example: <A1> EQ 2 displays 1, if the content of A1 equals 2

不等于

NEQ 或 !=

测试选中值是否不等。

Example: <A1> NEQ 2 displays 0 (wrong), if the content of A1 equals 2

小于等于

LEQ

测试小于或等于指定值的值。

Example: <A1> LEQ 2 displays 1 (true), if the content of A1 is less than or equal to 2

大于或等于

GEQ

Tests for values greater than or equal to a specified value.

Example: <A1> GEQ 2 displays 1 (true), if the content of A1 is greater than or equal to 2

小于

L

Tests for values less than a specified value.

Example: <A1> L 2 displays 1 (true), if the content of A1 is less than 2

大于

G

Tests for values greater than a specified value.

Example: <A1> G 2 displays 1 (true), if the content of A1 is greater than 2

布尔型 Or

OR

Tests for values matching the Boolean OR.

示例: 0 OR 0 结果显示为 0 (假),所有其它结果显示为 1 (真)

逻辑的除外的或

XOR

Tests for values matching the Boolean exclusive OR.

示例: 1 XOR 0 结果显示为 1 (真)

布尔型 And

AND

Tests for values matching the Boolean AND.

示例: 1 AND 2 结果显示为 1 (真)

布尔型 Not

NOT

Tests for values matching the Boolean NOT.

示例: NOT 1 (真) 结果显示为 0 (假)


统计函数

You can choose from the following statistical functions:

Function

Name

Example

Mean

MEAN

计算一个区域或一个列表中数值的算术平均值。

示例: MEAN 10|30|20 结果显示为 20

最小值

MIN

计算一个区域或一个列表中的最小值。

示例: MIN 10|30|20 显示为 10.00

最大值

MAX

计算一个区域或一个列表中的最大值。

Example: MAX 10|30|20 displays 30

Product

PRODUCT

Calculates the product of the selected cells.

Example: PRODUCT <A2:C2> displays the product of the values in cells A2 to C2

Count

COUNT

Counts the number of non empty cells.

Example: COUNT <A2:C2> displays the number of non empty cells in A2 to C2


Functions

You can choose from the following functions:

Function

Name

Example

正弦

SIN

Calculates the sine in radians.

Example: SIN (PI/2) displays 1

余弦

COS

计算余弦值,单位为弧度。

Example: COS 1 displays 0.54

正切

TAN

Calculates the tangent in radians.

示例: TAN <A1>

反正弦

ASIN

计算反正弦值,单位为弧度。

示例: ASIN 1

反余弦

ACOS

计算反余弦值,单位为弧度。

示例: ACOS 1

反正切

ATAN

计算反正切值,单位为弧度。

示例: ATAN 1

Absolute value

ABS

Returns the absolute value of the number.

Example: ABS -34 returns 34

Sign

SIGN

Returns the algebraic sign of the number.

Example: SIGN -23 returns -1


文档属性变量

文档的以下属性也可在「文件 - 属性 - 统计」中找到。

Name

Description

CHAR

文档中的字符数

WORD

文档中的单词数

PARA

文档中的段落数

GRAPH

文档中的图形数

TABLES

文档中的表格数

OLE

文档中的 OLE 对象数

PAGE

文档中的总页数


其他被定义的值

Description

Name

Value

PI

PI

3.1415...

欧拉数

E

2.71828...

TRUE

不等于 0

FALSE

0


请支持我们!