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

# ES|QL MV_AVG function
## Syntax

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


## Parameters

<definitions>
  <definition term="number">
    Multivalue expression.
  </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         |