计算指标和高级公式
本文由英文机器翻译。 当前显示英文原文。
Formula examples
Ratio (percentage): A/B*100
Divide metric A by metric B and multiply by 100 to get a percentage.

YTD
The YTD value is calculated as the sum of all values from the beginning of the year to the current period. If values are missing for any number of periods, use the Default value option to fill the gaps and make sure the formula is calculated.

Rolling YTD
Similar to YTD: sums all the values from the prior-year period (+1, so that it starts with the next period of the prior year) to the current period.

Mathematical functions
ABS
Returns the absolute value of a number, which is the number without its sign.
ABS(number)The syntax of the ABS function has the following arguments:
- Number: Required argument. The real number whose absolute value you want to find out.
LOG10
Returns the base-10 logarithm of a number.
LOG10(number)The syntax of the LOG10 function has the following arguments:
- Number: Required argument. The positive real number whose base-10 logarithm you want to calculate.
MOD
Returns the signed remainder after one number is divided by another.
MOD(dividend, divisor)The syntax of the MOD function has the following arguments:
- Dividend: Required argument. The number divided by the divisor.
- Divisor: Required argument. The number by which the dividend is divided.
POWER
Returns a number raised to a power.
POWER(number, power)The syntax of the POWER function has the following arguments:
- Number: Required argument. The base of the exponentiation. It can be any real number.
- Power: Required argument. The exponent to which the base is raised.
ROUND
Rounds a number to the specified number of digits.
ROUND(number, digits)The syntax of the ROUND function has the following arguments:
- Number: Required argument. The number you want to round.
- Digits: Required argument. The number of digits to which you want to round the number.
ROUNDUP
Rounds a number up, away from zero.
ROUNDUP(number, digits)The syntax of the ROUNDUP function has the following arguments:
- Number: Required argument. Any real number you want to round up.
- Digits: Required argument. The number of decimal places to which the number is rounded.
ROUNDDOWN
Rounds a number down, toward zero.
ROUNDDOWN(number, digits)The syntax of the ROUNDDOWN function has the following arguments:
- Number: Required argument. Any real number you want to round down.
- Digits: Required argument. The number of decimal places to which the number is rounded.
SQRT
Returns the square root of a number.
SQRT(number)The syntax of the SQRT function has the following arguments:
- Number: Required argument. The number whose square root you want to know.
TRUNC
Truncates a number to an integer by removing its decimal (fractional) part.
TRUNC(number, [digits])The syntax of the TRUNC function has the following arguments:
- Number: Required argument. The number you want to truncate.
- Decimals: Optional argument. The number of decimal places of the truncated number. The default is 0 (zero).
Logic functions
AND
Returns TRUE if all arguments are TRUE.
AND(A, B)The syntax of the AND function has the following arguments:
- A: Required argument. Condition.
- B: Required argument. Condition.
OR
Returns TRUE if at least one argument is TRUE.
OR(A, B)The syntax of the OR function has the following arguments:
- A: Required argument. Condition.
- B: Required argument. Condition.
XOR
Returns the logical exclusive OR of all arguments.
XOR(A, B)The syntax of the XOR function has the following arguments:
- A: Required argument. Condition.
- B: Required argument. Condition.
NOT
Performs a logical negation of its argument.
NOT(A)The syntax of the NOT function has the following arguments:
- A: Required argument. Condition.
TRUE
Returns the logical value TRUE.
FALSE
Returns the logical value FALSE.
IF
The IF function, one of the most popular functions in TeamGuru, lets you logically compare a value with your expectations.
An IF statement can have two results. The first result is returned if the condition evaluates as true; otherwise, the second result is returned.
IF(condition, a, b)The syntax of the IF function has the following arguments:
- condition: Required argument. The condition to evaluate.
- a: Required argument. The result of the IF function if the condition is TRUE.
- b: Required argument. The result of the IF function if the condition is FALSE.
IFERROR
Returns the specified value if the formula evaluates to an error; otherwise, returns the result of the formula.
IFERROR(value, value_on_error)The syntax of the IFERROR function has the following arguments:
- value: Required argument. The argument tested for an error.
- value_on_error: Required argument. The value returned if the formula results in an error.
ISNULL
Returns TRUE if the result of the formula is an empty value.
ISNULL(value)The syntax of the ISNULL function has the following arguments:
- value: Required argument. The argument tested for an empty or null value.
Statistical functions (over several periods)
AVERAGE
Calculates the average (arithmetic mean) of the values.
AVERAGE(values_list)The syntax of the AVERAGE function has the following arguments:
- values_list: Required argument. A list of values, defined in TeamGuru as a range of periods.
SUM
Calculates the sum of all values.
SUM(values_list)The syntax of the SUM function has the following arguments:
- values_list: Required argument. A list of values, defined in TeamGuru as a range of periods.
COUNT
Returns the number of values in a list.
COUNT(values_list)The syntax of the COUNT function has the following arguments:
- values_list: Required argument. A list of values, defined in TeamGuru as a range of periods.
MAX
Returns the maximum value from a list of values.
MAX(values_list)The syntax of the MAX function has the following arguments:
- values_list: Required argument. A list of values, defined in TeamGuru as a range of periods.
MIN
Returns the minimum value from a list of values.
MIN(values_list)The syntax of the MIN function has the following arguments:
- values_list: Required argument. A list of values, defined in TeamGuru as a range of periods.
MEDIAN
Returns the median of the given numbers. The median is the number in the middle of a set of numbers.
MEDIAN(values_list)The syntax of the MEDIAN function has the following arguments:
- values_list: Required argument. A list of values, defined in TeamGuru as a range of periods.
STDEVP
Returns the standard deviation of a population (base set) determined from a random selection. The standard deviation expresses how much the values differ from the mean value.
STDEVP(values_list)The syntax of the STDEVP function has the following arguments:
- values_list: Required argument. A list of values, defined in TeamGuru as a range of periods.
STDEVA
Calculates the standard deviation of a sample (selection). The standard deviation is the degree to which the values vary from the mean value.
STDEVA(values_list)The syntax of the STDEVA function has the following arguments:
- values_list: Required argument. A list of values, defined in TeamGuru as a range of periods.
LAST
Returns the last value entered in the list of values. Empty and null values are ignored.
LAST(values_list)The syntax of the LAST function has the following arguments:
- values_list: Required argument. A list of values, defined in TeamGuru as a range of periods.
公式示例
比率(百分比):A/B*100
用指标A除以指标B再乘以100,得到百分比。

YTD
YTD值是从年初到当前期间所有值的总和。如果有任意数量的期间缺少数值,请使用默认值选项填补空缺,确保公式能够计算。

滚动YTD
与YTD类似:对从上一年对应期间(+1,即从上一年的下一个期间开始)到当前期间的所有值求和。

数学函数
ABS
返回数字的绝对值,即不带符号的数字。
ABS(number)ABS函数语法具有以下参数:
- Number:必需参数。需要求绝对值的实数。
LOG10
返回数字以10为底的对数。
LOG10(number)LOG10函数语法具有以下参数:
- Number:必需参数。需要计算以10为底的对数的正实数。
MOD
返回两数相除后的余数(带符号)。
MOD(dividend, divisor)MOD函数语法具有以下参数:
- Dividend:必需参数。被除数。
- Divisor:必需参数。除数。
POWER
返回数字的乘幂。
POWER(number, power)POWER函数语法具有以下参数:
- Number:必需参数。底数,可以是任意实数。
- Power:必需参数。底数的指数。
ROUND
将数字四舍五入到指定位数。
ROUND(number, digits)ROUND函数语法具有以下参数:
- Number:必需参数。要四舍五入的数字。
- Digits:必需参数。要保留的位数。
ROUNDUP
远离零向上舍入数字。
ROUNDUP(number, digits)ROUNDUP函数语法具有以下参数:
- Number:必需参数。需要向上舍入的任意实数。
- Digits:必需参数。舍入后保留的小数位数。
ROUNDDOWN
朝零方向向下舍入数字。
ROUNDDOWN(number, digits)ROUNDDOWN函数语法具有以下参数:
- Number:必需参数。需要向下舍入的任意实数。
- Digits:必需参数。舍入后保留的小数位数。
SQRT
返回数字的平方根。
SQRT(number)SQRT函数语法具有以下参数:
- Number:必需参数。要求平方根的数字。
TRUNC
去掉数字的小数部分,将其截尾取整。
TRUNC(number, [digits])TRUNC函数语法具有以下参数:
- Number:必需参数。需要截尾取整的数字。
- Decimals:可选参数。截尾后保留的小数位数,默认值为0(零)。
逻辑函数
AND
所有参数均为TRUE时,返回TRUE。
AND(A, B)AND函数语法具有以下参数:
- A:必需参数。条件。
- B:必需参数。条件。
OR
至少有一个参数为TRUE时,返回TRUE。
OR(A, B)OR函数语法具有以下参数:
- A:必需参数。条件。
- B:必需参数。条件。
XOR
返回所有参数的逻辑异或值。
XOR(A, B)XOR函数语法具有以下参数:
- A:必需参数。条件。
- B:必需参数。条件。
NOT
对参数执行逻辑非运算。
NOT(A)NOT函数语法具有以下参数:
- A:必需参数。条件。
TRUE
返回逻辑值TRUE。
FALSE
返回逻辑值FALSE。
IF
IF函数是TeamGuru中最常用的函数之一,可将某个值与您的预期进行逻辑比较。
IF语句可能有两个结果。如果条件为真,返回第一个结果;否则返回第二个结果。
IF(condition, a, b)IF函数语法具有以下参数:
- condition:必需参数。要判断的条件。
- a:必需参数。条件为TRUE时IF函数返回的结果。
- b:必需参数。条件为FALSE时IF函数返回的结果。
IFERROR
如果公式计算结果为错误,则返回指定的值;否则返回公式的结果。
IFERROR(value, value_on_error)IFERROR函数语法具有以下参数:
- value:必需参数。检查是否存在错误的参数。
- value_on_error:必需参数。公式计算结果为错误时返回的值。
ISNULL
如果公式结果为空值,返回TRUE。
ISNULL(value)ISNULL函数语法具有以下参数:
- value:必需参数。检查是否为空值或null值的参数。
统计函数(跨多个期间)
AVERAGE
计算各值的平均值(算术平均值)。
AVERAGE(values_list)AVERAGE函数语法具有以下参数:
- values_list:必需参数。值列表,在TeamGuru中定义为期间范围。
SUM
计算所有值的总和。
SUM(values_list)SUM函数语法具有以下参数:
- values_list:必需参数。值列表,在TeamGuru中定义为期间范围。
COUNT
返回列表中值的个数。
COUNT(values_list)COUNT函数语法具有以下参数:
- values_list:必需参数。值列表,在TeamGuru中定义为期间范围。
MAX
返回值列表中的最大值。
MAX(values_list)MAX函数语法具有以下参数:
- values_list:必需参数。值列表,在TeamGuru中定义为期间范围。
MIN
返回值列表中的最小值。
MIN(values_list)MIN函数语法具有以下参数:
- values_list:必需参数。值列表,在TeamGuru中定义为期间范围。
MEDIAN
返回给定数字的中值。中值是一组数字中位于中间的数字。
MEDIAN(values_list)MEDIAN函数语法具有以下参数:
- values_list:必需参数。值列表,在TeamGuru中定义为期间范围。
STDEVP
返回根据随机抽样确定的总体(基础集)标准偏差。标准偏差反映各值与平均值的偏离程度。
STDEVP(values_list)STDEVP函数语法具有以下参数:
- values_list:必需参数。值列表,在TeamGuru中定义为期间范围。
STDEVA
计算样本(抽样)的标准偏差。标准偏差反映各值与平均值的偏离程度。
STDEVA(values_list)STDEVA函数语法具有以下参数:
- values_list:必需参数。值列表,在TeamGuru中定义为期间范围。
LAST
返回值列表中最后输入的值。空值和null值会被忽略。
LAST(values_list)LAST函数语法具有以下参数:
- values_list:必需参数。值列表,在TeamGuru中定义为期间范围。
还需要帮助吗?
请给我们留言。工作日我们通常会在一小时内回复。