# MV_MEDIAN

Converts a multivalued field into a single-valued field containing the median value.

## Syntax

`MV_MEDIAN(number)`

### Parameters

#### `number`

Multivalue expression.

## Examples

```esql
ROW a=[3, 5, 1]
| EVAL median_a = MV_MEDIAN(a)
```

Calculate the median value of the multivalued column `a`.

```esql
ROW a=[3, 7, 1, 6]
| EVAL median_a = MV_MEDIAN(a)
```

For rows with an even number of values, the result is the average of the middle two entries. If the column is not of a floating-point type, the average rounds **down**.
