---
title: ES|QL MV_AVG function
description: 
url: https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/mv-functions/mv_avg
products:
  - Elasticsearch
---

# ES|QL MV_AVG function
## Syntax

![Embedded](https://www.elastic.co/docs/reference/query-languages/esql/images/generated/x-pack-esql/functions/mv_avg.svg)


## Parameters

<definitions>
  <definition term="number">
    Expression that can be null, a single value, or multiple values.
  </definition>
</definitions>


## Description

Converts a multivalued field into a single valued field containing the average of all of the values.

## Supported types


| number        | result |
|---------------|--------|
| double        | double |
| integer       | double |
| long          | double |
| unsigned_long | double |


## Example

```esql
ROW a=[3, 5, 1, 6]
| EVAL avg_a = MV_AVG(a)
```


| a:integer    | avg_a:double |
|--------------|--------------|
| [3, 5, 1, 6] | 3.75         |