The MEDIAN() function returns the median value of a set of numbers, that is, the middle value when the values are sorted in ascending order.
Function compatible with fields from a relation: the calculation is applied to all linked items.
Numeric function name:
MEDIAN()
Syntax
MEDIAN(value1, value2, …)ℹ Calling function parameters in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to be added between quotation marks.
- do not use quotation marks for numbers.
Parameters
| Parameter | Description |
|---|---|
value1 |
Set of numerical values |
value2… |
(Optional) Other set of numerical values |
Example
MEDIAN(3, 1, 8, 9, 2)Result: 3
MEDIAN(1, 2, 3, 4)Result: 2.5
Notes
Values are automatically sorted before calculating the median.
Non-numeric values are ignored.
- If the input is a field from a relation, the median is calculated on all linked items.
Return type
The function returns a number.
The output type format of the result can be configured in the output field options of the formula editor. For more details, see Output format options in the Formula column article.