> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Supported math and number functions

> Omni supports functions typically found in most spreadsheet applications such as Google Sheets. This reference details the math and number functions supported by Omni.

## Working with math functions

Some math expressions will contain binary operators. These are operators that take both a left and right operand. For example, in `1 + 2`:

* `1` is the left operand
* `+` is the binary operator
* `2` is the right operand

When working with expressions, note that they will follow the standard order of operations. This means the expression will multiply and divide before addition and subtraction. Use parenthesis to clarify the expression or alter the order.

## Supported operators

| Name                     | Operator |
| :----------------------- | :------- |
| Concatenate              | `&`      |
| Plus                     | `+`      |
| Minus                    | `-`      |
| Multiply                 | `*`      |
| Divide                   | `/`      |
| Exponentiate             | `^`      |
| Greater than             | `>`      |
| Greater than or equal to | `>=`     |
| Equal to                 | `=`      |
| Less than                | `<`      |
| Less than or equal to    | `<=`     |

## ABS

Returns the absolute value of a number. The `value` argument can be a numeric value (`3`) or a reference to a cell, range, or column containing numeric data.

For more information, refer to the [Google Sheets documentation](https://support.google.com/appsheet/answer/10107329?hl=en\&sjid=7987109666653796078-NC).

```
ABS(value)
```

**Example**

```
ABS(-14)
```

## ACOS

Returns the arccosine of a number. This function returns the angle whose cosine is the specified number.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093582?hl=en).

```
ACOS(number)
```

**Example**

```
ACOS(0.5)
```

## ATAN

Returns the arctangent of a number. Specifically, this function returns the angle whose tangent is the specified number.

For additional information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093395?hl=en).

```
ATAN(number)
```

**Example**

```
ATAN(0.5)
```

## AVERAGE

Averages a list of numbers. The list can be composed of number literals (`10`), cell references (`A1`), cell ranges (`B4:B9`), and column references (`C:C`).

When used, the function will apply to all values in the column.

For more details, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093615?hl=en).

```
AVERAGE(value1, value2, ...)
```

**Example**

```
AVERAGE(1, 2, 3, 4)
```

## AVERAGEIFS

Returns the average of a range depending on specified criteria.

For more details, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3256534?hl=en).

```
AVERAGEIFS(range_to_average, criteria_range1, criterion1, [criteria_range2, criterion2, ...])
```

**Example**

```
AVERAGEIFS(A1:A10, B1:B10, ">20")
```

## CEILING

Rounds numbers up to the nearest integer multiple of (optional) specified significance. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093471?hl=en).

```
CEILING(value, <significance-optional>)
```

**Example**

```
CEILING(A1, .05)
```

## CORREL

Returns the correlation coefficient of the `array1` and `array2` cell ranges. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093990?hl=en).

```
CORREL(array1, array2)
```

**Example**

```
CORREL(A1:A3, B1:B3)
```

## COS

Returns the cosine of an angle, in radians. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093476?hl=en\&ref_topic=3105474\&sjid=7436250830009921699-NA).

```
COS(number)
```

**Example**

```
COS(45)
```

## COT

Returns the cotangent of an angle, in radians. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/9084169?hl=en\&ref_topic=3105474\&sjid=7436250830009921699-NA).

```
COT(number)
```

**Example**

```
COT(45)
```

## COUNT

Counts the number of cells that contain values in the column. When used, the formula will be applied to the entire column. For more information, refer to the see the [Google Sheets documentation](https://support.google.com/docs/answer/3093620?sjid=7436250830009921699-NA).

The value can be a reference to a cell (`E1`), a range (`B4:B9`), or a column (`C:C`).

```
COUNT(value)
```

**Example**

```
COUNT(A1)COUNT(A1:A12)COUNT(D:D)
```

## COUNTA

Counts the number of cells that are not empty. The value can be a reference to a cell (`E1`), a range (`B4:B9`), or a column (`C:C`). For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093991?hl=en).

```
COUNTA(value)
```

**Example**

```
COUNTA(A1)
```

## COUNTIF

Counts the number of cells that contain values that meet a given criteria. This function takes two arguments:

* `cell_range` – The range the `criteria` argument is applied to
* `criteria` – The condition applied to the specified `cell_range`. **Note**: Criteria arguments are not case sensitive.

```
COUNTIF(cell_range, criteria)
```

**Example**

```
COUNTIF(A2:A5, A1 >= 2)
```

**Limitations**

* `string` data types are not supported for `COUNTIF`
* Only works with conditional counts with a single criterion. To use multiple criteria, use [`COUNTIFS`](#countifs).

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093480?hl=en).

## COUNTIFS

Counts the number of cells that contain values that meet given criteria.

* `cell_range` – The range the `criteria` argument is applied to
* `criteria` – The condition - which can include multiple arguments - applied to the specified `cell_range`. **Note**: Criteria arguments are not case sensitive.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3256550?hl=en).

```
COUNTIFS(cell_range, criteria1, [criteria2-optional])
```

**Example**

```
COUNTIFS(A1:A5, A1 > 2, B3:B10, B1 > A1)
```

**Limitations**

`string` data types are not supported for `COUNTIF`

## COVAR

Returns covariance, the average of the products of deviations. Equivalent to `COVAR.S`.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093993?hl=en\&sjid=10665742387146177313-NC).

```
COVAR(array1, array2)
```

**Example**

```
COVAR(A1:A10, B1:B10)
```

## COVARIANCE.P

Returns covariance, the average of the products of deviations of a population.

```
COVARIANCE.P(array1, array2)
```

**Example**

```
COVARIANCE.P(A1:A3, B1:B3)
```

## DEGREES

Converts radians to degrees. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093481?hl=en).

```
DEGREES(radians)
```

**Example**

```
DEGREES(1.047)
```

## EXP

Returns `e` raised to the power of a given number.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093411?hl=en).

```
EXP(number)
```

**Example**

```
EXP(2)
```

## FLOOR

Rounds a number down to the nearest integer multiple of specified significance.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093487?hl=en\&ref_topic=3105474\&sjid=5673436338131149083-NA).

```
FLOOR(value, <significance-optional>)
```

**Example**

```
FLOOR(A1, .05)
```

## INT

Rounds a number down to the nearest integer that is less than or equal to it. Alias for `FLOOR`.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093490?hl=en\&ref_topic=3105474\&sjid=5673436338131149083-NA).

```
INT(value)
```

**Example**

```
INT(8.9)
```

## INTERCEPT

Returns the intercept of the linear regression line through data points in Y and X data points. This function takes two arguments:

* `known_y_range` - Range of values representing the dependent (y) data
* `known_x_range` - Range of values representing the independent (x) data

**Note**: Any text of type `string` encountered in the value arguments will return null values.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093632?hl=en).

```
INTERCEPT(known_y_range, known_x_range)
```

**Example**

```
INTERCEPT(A1:A100, B1:B100)
```

## LARGE

Returns the `nth` largest value in a data set. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094008?hl=en\&ref_topic=3105600\&sjid=5673436338131149083-NA).

```
LARGE(array, k)
```

**Example**

```
LARGE(A1:A100, 4)
```

## LN

Returns the natural logarithm of a number. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093422?hl=en).

```
LN(number)
```

**Example**

```
LN(100)
```

## LOG

Returns the logarithm of a number to the specified base. If `base` isn't specified, the default of `10` will be used.

For more information, refer to the [Google Sheets LOG() function documentation](https://support.google.com/docs/answer/3093495?hl=en\&ref_topic=3105474\&sjid=5673436338131149083-NA).

```
LOG(number, [base-optional])
```

**Example**

```
LOG(100, 10)
```

## LOG10

Returns the base-10 logarithm of a number. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093423?sjid=5673436338131149083-NA).

```
LOG10(number)
```

**Example**

```
LOG10(100)
```

## MAX

Returns the largest number in a set. Only a single column or range may be provided as an argument.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094013?hl=en).

```
MAX(range)
```

**Example**

```
MAX(A1:A5)
```

## MAXIFS

Returns the maximum value in a range of cells, filtered by a list of criteria.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/7013817).

```
MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], ... )
```

**Example**

```
MAXIFS(D4:E5, F4:G5, “>5”, F6:G7, “<10”)
```

## MEDIAN

Returns the median number in a set. Only a single column or range may be provided as an argument.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094025?sjid=5673436338131149083-NA).

```
MEDIAN(range)
```

**Example**

```
MEDIAN(B2:B8)
```

## MIN

Returns the smallest number in a set. Only a single column or range may be provided as an argument.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094017?sjid=5673436338131149083-NA).

```
MIN(range)
```

**Example**

```
MIN(C1:C10)
```

## MINIFS

Returns the minimum value in a range of cells, filtered by a list of criteria.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/7014063).

```text theme={null}
MINIFS(min_range, criteria_range1, criteria1, [criteria_range2, criteria2], ... )
```

**Example**

```text theme={null}
MINIFS(D4:E5, F4:G5, ">5", F6:G7, "<10")
```

## MOD

Returns the remainder from division. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093497?hl=en).

```
MOD(dividend, divisor)
```

**Example**

```
MOD(10, 3)
```

## MODE

Returns the most common number in a set. Only a single column or range may be provided as an argument.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094029?hl=en).

```
MODE(range)
```

**Example**

```
MODE(A1:A5)
```

## OMNI\_RANK

Returns the rank of a number in a list of numbers. Similar to [`RANK`](#rank), but the third argument indicates whether ranking is performed over rows or columns instead of specifying sort direction.

```text theme={null}
OMNI_RANK(number, range, [is_in_row_direction])
```

* `number` - The value to rank
* `range` - The range of values to rank against
* `is_in_row_direction` - **Optional**. If `TRUE`, ranks across rows. If `FALSE` or omitted, ranks across columns.

**Example**

```text theme={null}
OMNI_RANK(A1, A1:A10)
OMNI_RANK(A1, A1:E1, TRUE)
```

## RAND

Generates a random number between 0 and 1. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093438).

```
RAND()
```

**Example**

```
RAND()
```

## RANK

Returns the rank of a number in a list of numbers. The `direction` argument is optional, and if omitted will default to `descending`.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094098?hl=en).

```
RANK(number, ref, [direction])
```

**Example**

```
RANK(number, ref, [direction])
```

<Check>
  Use in combination with a [filter](/visualize-present/dashboards/filters) on this calculation to get a top `N` list. For example, `calc <= 5`
</Check>

## ROUND

Rounds a number to a specified number of digits. The `num_digits` argument is optional and will default to `0` if not provided.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093440?hl=en).

```
ROUND(number, [num_digits])
```

**Example**

```
ROUND(100.1234, 2)
```

## ROUNDDOWN

Rounds a number down, towards zero, to a specified number of digits. The `num_digits` argument is optional and will default to `0` if not provided.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093442).

```
ROUNDDOWN(number, [num_digits])
```

**Example**

```
ROUNDDOWN(100.1234, 2)
```

## ROUNDUP

Rounds a number up, away from zero, to a specified number of digits. The `num_digits` argument is optional and will default to `0` if not provided.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093443).

```
ROUNDUP(number, [num_digits])
```

**Example**

```
ROUNDUP(100.1234, 2)
```

## SLOPE

Returns the slope of the linear regression line through data points in Ys and Xs. This function accepts two arguments:

* `known_y_range` - The range representing the array or matrix of dependent data
* `known_x_range` - The range representing the array or matrix of independent data

**Note**: Any text of type `string` encountered in the value arguments will return null values.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094048?hl=en).

```
SLOPE(known_y_range, known_x_range)
```

**Example**

```
SLOPE(A1:A100, D1:D100)
```

## SMALL

Returns the nth smallest value in a data set. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094050).

```
SMALL(array, n)
```

**Example**

```
SMALL(A1:A100, 4)
```

## SQRT

Returns a positive square root. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093577?hl=en).

```
SQRT(number)
```

**Example**

```
SQRT(100)
```

## STDEV

Estimates the standard deviation based on a population of values. This function accepts a single argument:

* `value` - Can be a reference to a cell (`E1`), a range (`B4:B9`), or a column (`C:C`). **Note**: If the value contains references to text values, the calculation will be returned as `null`.

```
STDEV(value)
```

**Examples**

```
STDEV(A1)STDEV(A1:A5)
```

**Limitations**

There is not full parity of functionality between the `STDEV` function in Google Sheets and Omni. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094054?hl=en).

## STDEV.P

Estimates the standard deviation based on an entire population. This function accepts a single argument:

* `value` - Can be a reference to a cell (`E1`), a range (`B4:B9`), or a column (`C:C`). **Note**: If the value contains references to text values, the calculation will be returned as `null`.

```
STDEV.P(value)
```

**Examples**

```
STDEV.P(A1)STDEV.P(A1:A5)
```

**Limitations**

There is not full parity of functionality between the `STDEV.P` function in Google Sheets and Omni. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094054?hl=en).

## SUM

Adds all the numbers in a range of cells. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093669?hl=en).

```
SUM(range)
```

**Example**

```
SUM(A1:A5)
```

## SUMIF

Adds the cells specified by a given criteria. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093583?sjid=7647925112231655710-NA).

```
SUMIF(range, criteria, [sum_range-optional])
```

**Example**

```
SUMIF(B2:B8, B2 > 5, C2:C8)
```

**Limitations**

Text (`string`) criteria is not supported.

## SUMIFS

Adds the cells specified by multiple criteria. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3238496?hl=en).

```
SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ... )
```

**Example**

```
SUMIFS(B2:B8, C2:C8, B2 > 5)
```

**Limitations**

Text (`string`) criteria is not supported.

## SUMPRODUCT

Returns the sum of the products of corresponding array components. For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094294?hl=en).

```
SUMPRODUCT(range1, range2, ...)
```

**Example**

```
SUMPRODUCT(A1:A5, B1:B5)
```

## TRUNC

Truncates a number to an integer by removing the decimal portion of a number. Alias for `FLOOR`.

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3093588?hl=en).

```
TRUNC(number)
```

**Example**

```
TRUNC(8.9)
```

## VALUE

Converts a text argument to a number. For more information, refer to the [Google Sheets VALUE() function documentation](https://support.google.com/docs/answer/3094220?hl=en).

```
VALUE(text)
```

**Example**

```
VALUE("123")
```

## VAR

Calculates the variance based on a sample of values. This function accepts a single argument, `value`. The `value` can be a number or a range of numbers.

```
VAR(value)
```

**Examples**

```
VAR(1)VAR(A1)VAR(A2:A25)
```

**Limitations**

There is not full parity of functionality between the `VAR` function in Google Sheets and Omni. For additional information, see the [Google Sheets documentation](https://support.google.com/docs/answer/3094063?hl=en).

## VAR.P

Returns the variance of a population. The value can be a number (`3`), a reference to a cell (`E1`), a range (`B4:B9`), or a column (`C:C`).

For more information, refer to the [Google Sheets documentation](https://support.google.com/docs/answer/3094113?sjid=7647925112231655710-NA).

```
VAR.P(value)
```

**Examples**

```
VAR.P(1)
VAR.P(A1)
VAR.P(A2:A25)
```
