# MV_MEDIAN

The MV_MEDIAN function converts a multivalued field into a single valued field containing the median value.

## Syntax

`MV_MEDIAN(number)`

### Parameters

#### number

A multivalue expression.

## Examples

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

If the row has an even number of values for a column, the result will be the average of the middle two entries. If the column is not floating point, the average rounds **down**:

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