Mathematical Functions

此类别包含 Calc 的「数学」函数。要打开「函数向导」,请选择「插入 - 函数」。

AGGREGATE

此函数返回区域内计算的聚合结果。您可以使用下面列出的不同聚合函数。「聚合函数」允许您在计算中省略隐藏的行、错误、SUBTOTAL 和其他 AGGREGATE 函数的结果.

RAWSUBTRACT

减去一组数字并给出结果, 而不消除小的舍入误差。

SUM

Adds a set of numbers.

COLOR

返回 RGBA 颜色系统中由三种颜色 (红色、绿色和蓝色) 和 alpha 通道组合计算的数值。结果与您计算机所使用的颜色系统相关。

SUMIFS

返回多个区域中满足多个条件的区域中的单元格值之和。

ABS

返回数字的绝对值。

语法

ABS(数字)

数字」是指要计算其绝对值的数值。一个数值的绝对值是不带 +/- 号的数值。

示例

=ABS(-56)」返回 56。

=ABS(12)」返回 12。

=ABS(0)」返回 0。

ACOS

返回一个数字的反三角余弦值。

语法

ACOS(数字)

此函数返回「数字」的反三角余弦值,即该角度 (用弧度表示) 的余弦是 Number。返回的角度在 0 和 PI 之间。

要返回角度,请使用 DEGREES 函数。

示例

=ACOS(-1)」返回 3.14159265358979 (PI 弧度)

=DEGREES(ACOS(0.5))」返回 60。60 度的余弦值是 0.5。

打开文件示例:

ACOSH

返回一个数字的反双曲余弦值。

语法

ACOSH(数字)

此函数返回「数字」的反双曲线余弦值,即该值的双曲余弦值是 Number。

Number 必须大于或等于 1。

示例

=ACOSH(1)」返回 0。

=ACOSH(COSH(4))」返回 4。

打开文件示例:

ACOT

返回给定数值的反余切值。

语法

ACOT(数字)

此函数返回「数字」的反三角余切值,即该角度 (用弧度表示) 的余切是 Number。返回的角度在 0 和 PI 之间。

要返回角度,请使用 DEGREES 函数。

示例

=ACOT(1)」返回 0.785398163397448 (PI/4 弧度)。

=DEGREES(ACOT(1))」返回 45。45 度的正切值是 1。

打开文件示例:

ACOTH

返回给定数字的反双曲余切值。

语法

ACOTH(数字)

此函数返回「数字」的反双曲余切值,即该值的双曲余切值是 Number。

如果 Number 的值在 -1 和 1 (包含 -1 和 1) 之间,那么会有一个错误产生。

示例

=ACOTH(1.1)」返回 1.1 的双曲余切值,近似值 1.52226。

打开文件示例:

ASIN

返回一个数字的反三角正弦值。

语法

ASIN(数字)

此函数返回「数字」的反三角正弦值,即该角度 (用弧度表示) 的正弦是 Number。返回的角度在 -PI/2 和 +PI/2 之间。

要返回角度,请使用 DEGREES 函数。

示例

=ASIN(0)」返回 0。

=ASIN(1)」返回 1.5707963267949 (PI/2 弧度)。

=DEGREES(ASIN(0.5))」返回 30。30 度的正弦值是 0.5。

打开文件示例:

ASINH

返回一个数字的反双曲正弦值。

语法

ASINH(数字)

此函数返回「数字」的反双曲正弦值,即双曲正弦是 Number 的数值。

示例

=ASINH(-90)」返回近似值 -5.1929877。

=ASINH(SINH(4))」返回 4。

打开文件示例:

ATAN

返回一个数字的反三角正切值。

语法

ATAN(数字)

此函数返回「数字」的反三角正切值,即该角度 (用弧度表示) 的正切是 Number。返回的角度在 -PI/2 和 PI/2 之间。

要返回角度,请使用 DEGREES 函数。

示例

=ATAN(1)」返回 0.785398163397448 (PI/4 弧度)。

=DEGREES(ATAN(1))」返回 45。45 度的正切值是 1。

打开文件示例:

ATAN2

返回从原点到点 (数字X|数字Y) 的直线与 x 轴之间的角度 (以弧度为单位)。

note

此功能是「用于 Office 应用程序的开放文档格式 (OpenDocument)」标准 1.2 版本的一部分。(ISO/IEC 26300:2-2015)


语法

ATAN2(NumberX; NumberY)

NumberX」是 x 坐标的值。

NumberY」是 y 坐标的值。

tip

编程语言的 atan2() 函数通常具有相反的参数顺序。


ATAN2 返回从原点到点 (数字X|数字Y) 的直线与 x 轴之间的角度 (以弧度为单位)

示例

=ATAN2(-5;9)」返回 2.07789 弧度。

要获得以度数为单位的角度, 请对结果应用 DEGREES 函数。

=DEGREES(ATAN2(12.3;12.3)) 返回 45。45 度的正切值是 1。

note

LibreOffice 中 ATAN2(0;0) 返回 0。


该函数可用于将笛卡尔坐标转换为极坐标。

=DEGREES(ATAN2(-8;5)) 返回 φ = 147.9 度

笛卡尔坐标到极坐标示例

打开文件示例:

ATANH

计算一个数字的反双曲正切值。

语法

ATANH(数字)

此函数返回「数字」的反双曲正切值,即该值的双曲正切值是 Number。

Number 必须满足条件: -1 < number < 1。

示例

=ATANH(0)」返回 0。

打开文件示例:

COMBIN

返回元素所有组合的数目 (不计重复)。

语法

COMBIN(Count1; Count2)

Count1」是指集合中条目的总数。

Count2」是指在集合中所选择的条目的数量。

COMBIN 返回按照顺序组合方式选择条目的种类。例如,如果一个集合有 3 个条目 A、B 和 C,则您可以用 3 种不同的方式来选择 2 项,分别是 AB、AC 和 BC。

COMBIN 执行公式: Count1!/(Count2!*(Count1-Count2)!)

示例

=COMBIN(3;2)」返回 3。

COMBINA

返回条目的一个子集的所有组合的数目 (计算重复)。

语法

COMBINA(Count1; Count2)

Count1」是指集合中条目的总数。

Count2」是指在集合中所选择的条目的数量。

COMBINA 返回选择元素的组合方式数目,与选择顺序无关,并且允许重复选择元素。例如,如果一个集合有 3 个条目 A、B 和 C,则您可以用 6 种不同的方式来选择 2 项,分别是 AB、BA、AC、CA、BC 和 CB。

COMBINA 执行公式: (Count1+Count2-1)!/ (Count2!(Count1-1)!)

示例

=COMBINA(3;2)」返回 6。

CONVERT_OOO

Converts to euros a currency value expressed in one of the legacy currencies of 19 member states of the Eurozone, and vice versa. The conversion uses the fixed exchange rates at which the legacy currencies entered the euro.

tip

We recommend using the more flexible EUROCONVERT function for converting between these currencies. CONVERT_OOO is not a standardized function and is not portable.


语法

CONVERT_OOO(Value; "Text1"; "Text2")

Value is the amount of the currency to be converted.

Text1 is a three-character string that specifies the currency to be converted from.

Text2 is a three-character string that specifies the currency to be converted to.

Text1 and Text2 must each take one of the following values: "ATS", "BEF", "CYP", "DEM", "EEK", "ESP", "EUR", "FIM", "FRF", "GRD", "IEP", "ITL", "LTL", "LUF", "LVL", "MTL", "NLG", "PTE", "SIT", and "SKK".

One, and only one, of Text1 or Text2 must be equal to "EUR".

示例

=CONVERT_OOO(100;"ATS";"EUR") returns the euro value of 100 Austrian schillings.

=CONVERT_OOO(100;"EUR";"DEM") converts 100 euros into German marks.

tip

Refer to the CONVERT_OOO wiki page for more details about this function.


COS

返回给定角度 (用弧度表示) 的余弦值。

语法

COS(数字)

返回「数字」的 (三角) 余弦值,用弧度表示的角度。

要返回角度的余弦值,请使用 RADIANS 函数。

示例

=COS(PI()/2)」返回 0,PI/2 弧度的余弦值。

=COS(RADIANS(60))」返回 0.5,60 度角的余弦值。

打开文件示例:

COSH

返回一个数字的双曲余弦值。

语法

COSH(数字)

返回「数字」的双曲余弦值。

示例

=COSH(0)」返回 1,0 的双曲余弦值。

打开文件示例:

COT

返回给定角度 (用弧度表示) 的余切值。

语法

COT(数字)

返回用弧度表示的角度「数字」的 (三角) 余切值。

可以使用 RADIANS 函数来返回一个角度 (用度数表示) 的余切值。

一个角的余切值等于 1 除以该角的正切值。

示例:

=COT(PI()/4)」返回 1,PI/4 弧度的余切值。

=COT(RADIANS(45))」返回 1,45 度角的余切值。

打开文件示例:

COTH

返回给定数字 (角度) 的双曲余切值。

语法

COTH(数字)

返回「数字」的双曲余切值。

示例

=COTH(1)」返回 1 的双曲余切值,近似值 1.3130。

打开文件示例:

CSC

返回给定角度的余割 (单位: 弧度)。角度的余割值等于 1 除以该角的正弦

tip

This function is available since LibreOffice 3.5.


语法

CSC(数字)

返回弧度角「数字」的 (三角) 余割。

要以度为单位返回角的余割值,请使用 RADIANS 函数。

示例

=CSC(PI()/4)」的返回值约等于 1.4142135624,即 PI/4 弧度的正弦的倒数。

=CSC(RADIANS(30))」返回 2,即 30 度的余割。

打开文件示例:

CSCH

返回数字的双曲余割。

tip

This function is available since LibreOffice 3.5.


语法

CSCH(数字)

返回「数字」的双曲余割。

示例

=CSCH(1)」的返回值约为 0.8509181282,即 1 的双曲余割。

打开文件示例:

DEGREES

将弧度转换为度。

语法

DEGREES(数字)

数字」是指将被转换为度数的用弧度表示的角度值。

示例

=DEGREES(PI())」返回 180 度。

EUROCONVERT

此函数用于实现以前的欧洲货币值与现在的欧元之间的换算。

语法

EUROCONVERT(Value; "From_currency"; "To_currency" [; full_precision [; triangulation_precision]])

」是指要换算的货币数目。

From_currency」和「To_currency」分别是换算前和换算后的货币单位,这些必须是货币的官方缩写文本 (例如,"EUR")。所采用的汇率 (以每欧元表示) 是由欧洲委员会制定的。

Full_precision」是可选的。如果忽略或为 False,则结果参照 To 货币的小数部分被舍入。如果 Full_precision 为 True,结果不被舍入。

Triangulation_precision」是可选的。如果 Triangulation_precision 已给定且 >=3,三角转换 (currency1,EUR,currency2) 的中间结果舍入到该精度。如果忽略 Triangulation_precision,中间结果不被舍入。此外,如果 To 货币为 "EUR",则也会使用 Triangulation_precision,正如需要三角转换并且应用从 EUR 到 EUR 的转换一样。

示例

=EUROCONVERT(100;"ATS";"EUR")」将 100 奥地利先令换算成欧元。

=EUROCONVERT(100;"EUR";"DEM")」将 100 欧元换算成德国马克。

EVEN

将正数向上舍入为下一个偶数,将负数向下舍入为下一个偶数。

语法

EVEN(数字)

返回「数字」远离零值,向上舍入到下一个偶数的数值。

示例

=EVEN(2.3)」返回 4。

=EVEN(2)」返回 2。

=EVEN(0)」返回 0。

=EVEN(-0.5)」返回 -2。

EXP

Returns e raised to the power of a number. The constant e has a value of approximately 2.71828182845904.

语法

EXP(数字)

数字」是以 e 为底数的指数。

示例

=EXP(1) returns 2.71828182845904, the mathematical constant e to Calc's accuracy.

FACT

返回一个数字的阶乘。

语法

FACT(数字)

返回 Number!,「数字」的阶乘,计算 1*2*3*4* ... * Number。

根据定义,=FACT(0) 返回 1。

负数的阶乘将返回「无效参数」错误信息。

示例

=FACT(3)」返回 6。

=FACT(0)」返回 1。

GCD

返回两个或多个整数的最大公约数。

最大公约数是可以整除所有给定整数的最大正整数。

语法

GCD(Integer 1 [; Integer 2 [; … [; Integer 255]]])

Integer 1, Integer 2, … , Integer 255 are integers, references to cells or to cell ranges of integers.

note

This function ignores any text or empty cell within a data range. If you suspect wrong results from this function, look for text in the data ranges. To highlight text contents in a data range, use the value highlighting feature.


示例

=GCD(16;32;24)」返回 8,因为 8 是整除 16、24 和 32 的最大数字。

=GCD(B1:B3)」的结果为 3,其中单元格 B1、B2 和 B3 包含「9」「12」和「9」。

GCD_EXCEL2003

结果为一组数字的最大公约数。

note

名称以「_ADD」或「_EXCEL2003」结尾的函数与 Microsoft Excel 2003 中不含后缀的相应函数返回相同结果。使用不带后缀的函数,得到的结果符合国际标准。


语法

GCD_EXCEL2003(Number 1 [; Number 2 [; … [; Number 255]]])

Number 1, Number 2, … , Number 255 are numbers, references to cells or to cell ranges of numbers.

示例

=GCD_EXCEL2003(5;15;25)」返回 5。

INT

将数字舍入为最接近的整数。

语法

INT(数字)

返回「数字」向下舍入到最接近整数的数值。

负数向下舍入到下面的整数。

示例

=INT(5.7)」返回 5。

=INT(-1.3)」返回 -2。

LCM

计算一个或多个整数的最小公倍数。

语法

LCM(Integer 1 [; Integer 2 [; … [; Integer 255]]])

Integer 1, Integer 2, … , Integer 255 are integers, references to cells or to cell ranges of integers.

note

This function ignores any text or empty cell within a data range. If you suspect wrong results from this function, look for text in the data ranges. To highlight text contents in a data range, use the value highlighting feature.


示例

If you enter the numbers 512; 1024 and 2000 as Integer 1;2 and 3, then 128000 will be returned.

LCM_EXCEL2003

结果为一组数字的最小公倍数。

note

名称以「_ADD」或「_EXCEL2003」结尾的函数与 Microsoft Excel 2003 中不含后缀的相应函数返回相同结果。使用不带后缀的函数,得到的结果符合国际标准。


语法

LCM_EXCEL2003(Number 1 [; Number 2 [; … [; Number 255]]])

Number 1, Number 2, … , Number 255 are numbers, references to cells or to cell ranges of numbers.

示例

=LCM_EXCEL2003(5,15,25)」返回 75。

LN

返回以常数 e 为底的某个数值的自然对数。常数 e 的值约为 2.71828182845904。

语法

LN(数字)

数字」要计算其自然对数的值。

示例

=LN(3)」返回的是 3 的自然对数值 (近似于 1.0986)。

=LN(EXP(321))」返回 321。

LOG

计算数字以指定基数为底数的对数。

语法

LOG(Number [; Base])

数字」是指要计算其对数的数值。

Base」 (可选) 是对数计算的底数。如果忽略,则默认 10 为底数。

示例

=LOG(10;3)」返回以 3 为底的 10 的对数值 (近似于 2.0959)。

=LOG(7^4;7)」返回 4。

LOG10

返回以 10 为底数的对数。

语法

LOG10(数字)

返回「数字」以 10 为底的对数值。

示例

=LOG10(5)」返回底数为 -10 的 5 的对数值 (近似值 0.69897)。

MOD

返回某个数字除以除数之后的余数。

语法

MOD(被除数; 除数)

对于整数参数,该函数返回「被除数」以「除数」为模的结果,即「被除数」除以「除数」的余数。

该函数的实现原理为「被除数 - 除数 * INT(被除数/除数)」。该公式已给出参数不是整数时的算法。

示例

=MOD(22;3)」返回 1,是 22 除以 3 时得到的余数。

=MOD(11.25;2.5)」返回 1.25。

MROUND

将一个数字舍入为另一个数字最接近的倍数。

语法

MROUND(数字, 倍数)

返回「数字」舍入到最接近「倍数」倍数的值。

一个备选的实现方式为:「Multiple * ROUND(Number/Multiple)」。

示例

=MROUND(15.5,3)」返回 15,因为与 18 (= 3*6) 相比,15.5 更接近 15 (= 3*5)。

=MROUND(1.4,0.5)」返回 1.5 (= 0.5*3)。

MULTINOMIAL

返回各变量之和的阶乘除以各变量阶乘的乘积之商。

语法

MULTINOMIAL(Number 1 [; Number 2 [; … [; Number 255]]])

Number 1, Number 2, … , Number 255 are numbers, references to cells or to cell ranges of numbers.

note

This function ignores any text or empty cell within a data range. If you suspect wrong results from this function, look for text in the data ranges. To highlight text contents in a data range, use the value highlighting feature.


示例

如果 F11 到 H11 包含值「2」「3」和「4」「=MULTINOMIAL(F11:H11)」返回 1260。这相当于公式 =(2+3+4)! / (2!*3!*4!)

ODD

将正数向上舍入为最接近的奇数整数,并将负数向下舍入为最接近的奇数整数。

语法

ODD(数字)

返回「数字」远离零值,向上舍入到下一个奇数的数值。

示例

=ODD(1.2)」返回 3。

=ODD(1)」返回 1。

=ODD(0)」返回 1。

=ODD(-3.1)」返回 -5。

PI

返回 3.14159265358979,即数学常量 PI 的值,保留 14 位小数位数。

语法

PI()

示例

=PI()」返回 3.14159265358979。

POWER

返回给定数字的幂运算结果。

语法

POWER(底数; 指数)

返回「底数」的「指数」次幂。

通过幂运算符 ^ 可得到相同的结果:

Base^Exponent

note

=POWER(0,0) returns 1.


示例

=POWER(4;3)」返回 64,是 4 的 3 次幂。

=4^3 也返回 4 的 3 次方。

PRODUCT

将作为参数给出的所有数字相乘并返回乘积。

语法

PRODUCT(Number 1 [; Number 2 [; … [; Number 255]]])

Number 1, Number 2, … , Number 255 are numbers, references to cells or to cell ranges of numbers.

note

This function ignores any text or empty cell within a data range. If you suspect wrong results from this function, look for text in the data ranges. To highlight text contents in a data range, use the value highlighting feature.


示例

=PRODUCT(2;3;4)」返回 24。

QUOTIENT

返回除法运算的整数部分。

语法

QUOTIENT(分子; 分母)

返回「分子 除以 分母」后的整数部分。

对符号相同的分子与分母而言,QUOTIENT 与「INT(分子/分母) 相同,唯一的区别是报告错误的错误代码不同。更一般来说,它与 INT(分子/分母/SIGN(分子/分母))*SIGN(分子/分母)」等效。

示例

=QUOTIENT(11;3)」返回 3。余数 2 被省略。

RADIANS

将角度转换为弧度。

语法

RADIANS(数字)

数字」是指要被转换为弧度的用度数表示的角度值。

示例

=RADIANS(90)」返回 1.5707963267949,即 PI/2,该值根据 Calc 的精度而定。

RAND

返回 0 至 1 之间的随机数。

This function is always recalculated whenever a recalculation occurs.

语法

RAND()

该函数在Calc每次重新计算时生成一个随机数。若想要强制Calc重算,请按F9键。

To generate random numbers which never recalculate, either:

示例

=RAND()」返回介于 0 和 1 之间的随机数字。

RAND.NV

Returns a non-volatile random number between 0 and 1.

语法

RAND.NV()

This function produces a non-volatile random number on input. A non-volatile function is not recalculated at new input events. The function does not recalculate when pressing F9, except when the cursor is on the cell containing the function or using the Recalculate Hard command (Shift++F9). The function is recalculated when opening the file.

示例

=RAND.NV() returns a non-volatile random number between 0 and 1.

Technical information

tip

This function is available since LibreOffice 7.0.


This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.LIBREOFFICE.RAND.NV

RANDBETWEEN

返回一个在确定区域内的整型随机数。

This function is always recalculated whenever a recalculation occurs.

语法

RANDBETWEEN(下限; 上限)

返回一个介于「下限」和「上限」 (均包含) 之间的随机整数。

该函数在 Calc 每次重新计算时生成新的随机数。要手动强制 Calc 重新计算,请按「F9」键。

要生成非重新计算的随机数,复制包含此函数的单元格,并且使用「编辑 - 选择性粘贴」 (选中「数值」,而不选「全部粘贴」和「公式」)。

示例

=RANDBETWEEN(20;30)」返回介于 20 到 30 之间的整数。

RANDBETWEEN.NV

Returns an non-volatile integer random number in a specified range.

语法

RANDBETWEEN.NV(Bottom; Top)

Returns an non-volatile integer random number between integers Bottom and Top (both inclusive). A non-volatile function is not recalculated at new input events or pressing F9. However, the function is recalculated when pressing F9 with the cursor on the cell containing the function, when opening the file, when using the Recalculate Hard command (Shift++F9) and when Top or Bottom are recalculated.

示例

=RANDBETWEEN.NV(20;30) returns a non-volatile integer between 20 and 30.

=RANDBETWEEN.NV(A1;30) returns a non-volatile integer between the value of cell A1 and 30. The function is recalculated when the contents of cell A1 change.

Technical information

tip

This function is available since LibreOffice 7.0.


This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.LIBREOFFICE.RANDBETWEEN.NV

ROUND

将一个数字舍入到某一特定个数的小数位。

语法

ROUND(Number [; Count])

返回「数字」舍入到「位数」位小数的结果。如果「位数」被省略或者为零,该函数就舍入到最接近的整数。如果「位数」为负数,则此函数舍入到最接近的 10、100、1000 等数位。

此函数舍入到最近的数。另请参见 ROUNDDOWN 和 ROUNDUP。

示例

=ROUND(2.348;2)」返回 2.35

=ROUND(-32.4834;3)」返回 -32.483。修改单元格格式以查看所有小数。

=ROUND(2.348;0)」返回 2。

=ROUND(2.5)」返回 3。

=ROUND(987.65;-2)」返回 1000。

ROUNDDOWN

Truncates a number while keeping a specified number of decimal digits.

ROUNDUP

远离零值向上舍入某个数到指定精度。

语法

ROUNDUP(Number [; Count])

返回「数字」向上舍入 (远离零) 到「位数」位小数的结果。如果「位数」被省略或者为零,该函数就向上舍入到最接近的整数。如果「位数」为负数,则此函数向上舍入到最接近的 10、100、1000 等数位。

此函数朝着远离零的方向舍入。另请参见 ROUNDDOWN 和 ROUND。

示例

=ROUNDUP(1.1111;2)」返回 1.12。

=ROUNDUP(1.2345;1)」返回 1.3。

=ROUNDUP(45.67;0)」返回 46。

=ROUNDUP(-45.67)」返回 -46。

=ROUNDUP(987.65;-2)」返回 1000。

SEC

返回给定角度的正割 (单位: 弧度)。角度的正割等于 1 除以该角的余弦

tip

This function is available since LibreOffice 3.5.


语法

SEC(数字)

返回弧度角「数字」的 (三角) 正割。

要以度为单位返回角度的正割值,请使用 RADIANS 函数。

示例

=SEC(PI()/4)」的返回值约为 1.4142135624,即 π/4 弧度余弦的导数。

=SEC(RADIANS(60))」返回 2,即 60 度角的正割。

打开文件示例:

SECH

返回一个数的双曲正割。

tip

This function is available since LibreOffice 3.5.


语法

SECH(数字)

返回「数字」的双曲正割值。

示例

=SECH(0)」返回 1,即 0 的双曲正割。

打开文件示例:

SERIESSUM

计算一个幂级数的第一项之和。

SERIESSUM(x;n;m;c) = c1xn + c2xn+m + c3xn+2m + ... + cixn + (i-1)m.

语法

SERIESSUM(X; N; M; Coefficients)

X」是幂级数的输入值。

N」是初始乘幂

M」增加 N 的递增量

Coefficients」是一系列的系数。每多一个系数,该幂级数便增加一项。

示例

=SERIESSUM(A1; 0; 1; {1; 2; 3}) calculates the value of 1+2x+3x2, where x is the value in cell A1. If A1 contains 1, the formula returns 6; if A1 contains 2, the formula returns 17; if A1 contains 3, the formula returns 34; and so on.

tip

Refer to the SERIESSUM wiki page for more details about this function.


SIGN

返回数字的正负号。如果是正数则返回 1;如果是负值,则返回 -1。如果数字是零,则返回 0。

语法

SIGN(数字)

数字」确定其正负号的数字。

示例

=SIGN(3.4)」返回 1。

=SIGN(-4.5)」返回 -1。

SIN

返回给定角度 (用弧度表示) 的正弦值。

语法

SIN(数字)

返回用弧度表示的角度「数字」的 (三角) 正弦值。

要返回角度的正弦值,请使用 RADIANS 函数。

示例

=SIN(PI()/2)」返回 1,PI/2 弧度的正弦值。

=SIN(RADIANS(30))」返回 0.5,是 30 度的正弦值。

打开文件示例:

SINH

返回一个数字的双曲正弦值。

语法

SINH(数字)

返回「数字」的双曲正弦值。

示例

=SINH(0)」返回 0,0 的双曲正弦值。

打开文件示例:

SQRT

返回一个数的正平方根。

语法

SQRT(数字)

返回「数字」的正平方根。

「数字」必须为正数。

示例

=SQRT(16)」返回 4。

=SQRT(-16)」返回「无效参数」错误。

SQRTPI

返回一个数字与 PI 的乘积的平方根。

语法

SQRTPI(数字)

返回 (PI 乘以「数字r」) 的正平方根。

相当于「SQRT(PI()*数字)」。

示例

=SQRTPI(2)」返回 (2PI) 的平方根,约等于 2.506628。

SUBTOTAL

计算分类汇总。如果一个区域已包含分类汇总,则它们不能用于进一步的计算。将此函数和自动筛选同时使用,可以仅计算已筛选的记录。

语法

SUBTOTAL(Function; Range)

Function」是一个表示下列某个函数的数字:

函数索引

(包括隐藏值)

函数索引

(忽略隐藏值)

函数

1

101

AVERAGE

2

102

COUNT

3

103

COUNTA

4

104

MAX

5

105

MIN

6

106

PRODUCT

7

107

STDEV

8

108

STDEVP

9

109

SUM

10

110

VAR

11

111

VARP


使用数字 1-11 可包括手动隐藏的行,或使用 101-111 排除它们; 筛选排除掉的单元格总会被排除。

区域」是指公式必须顾及的单元格区域。

note

This function ignores any text or empty cell within a data range. If you suspect wrong results from this function, look for text in the data ranges. To highlight text contents in a data range, use the value highlighting feature.


示例

您在单元格范围 A1:B6 中有一个表格, 其中包含 10 名学生的材料清单。第 2 行 (笔) 手动隐藏。您希望看到显示的数字之和;也就是说, 仅包含筛选后的行的小计。在这种情况下, 正确的公式是:

A

B

1

ITEM

QUANTITY

2

10

3

铅笔

10

4

笔记本

10

5

橡皮

10

6

铅笔刀

10


=SUBTOTAL(9,B2B6) 返回 50.

=SUBTOTAL(109,B2:B6) 返回 40.

SUMIF

Adds the cells specified by a given criterion. This function is used to sum a range when you search for a certain value.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every regular expression metacharacter or operator with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in - LibreOffice Calc - Calculate.

warning

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".


语法

SUMIF(Range; Criterion [; SumRange])

Range is the range to which the criterion is to be applied.

Criterion: A criterion is a single cell Reference, Number or Text. It is used in comparisons with cell contents.

A reference to an empty cell is interpreted as the numeric value 0.

A matching expression can be:

SumRange」是指总和各个数值的区域。在没有输入参数的情况下,只会计算区域内的数值总和。

note

SUMIF supports the reference concatenation operator (~) only in the Range parameter, and only if the optional SumRange parameter is not given.


示例

仅对负数求和:「=SUMIF(A1:A10;"<0")

=SUMIF(A1:A10;">0";B1:B10) - sums values from the range B1:B10 only if the corresponding values in the range A1:A10 are >0.

请参见 COUNTIF(),以获取可用于 SUMIF() 的更多语法示例。

SUMSQ

Calculates the sum of the squares of a set of numbers.

语法

SUMSQ(Number 1 [; Number 2 [; … [; Number 255]]])

Number 1, Number 2, … , Number 255 are numbers, references to cells or to cell ranges of numbers.

note

This function ignores any text or empty cell within a data range. If you suspect wrong results from this function, look for text in the data ranges. To highlight text contents in a data range, use the value highlighting feature.


示例

If you enter the numbers 2; 3 and 4 in the Number 1; 2 and 3 arguments, 29 is returned as the result.

TAN

返回给定角度 (用弧度表示) 的正切值。

语法

TAN(数字)

返回用弧度表示的角度「数字」的 (三角) 正切值。

可以使用 RADIANS 函数来返回一个角度 (用度数表示) 的正切值。

示例

=TAN(PI()/4)」返回 1,PI/4 弧度的正切值。

=TAN(RADIANS(45))」返回 1,即 45 度的正切值。

打开文件示例:

TANH

返回一个数字的双曲正切值。

语法

TANH(数字)

返回「数字」的双曲正切值。

示例

=TANH(0)」返回 0,0 的双曲正切值。

打开文件示例:

TRUNC

Truncates a number while keeping a specified number of decimal digits.

请支持我们!