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

# ES|QL MV_COUNT function
## Syntax

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


## Parameters

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


## Description

Converts a multivalued expression into a single valued column containing a count of the number of values.

## Supported types


| field           | result  |
|-----------------|---------|
| boolean         | integer |
| cartesian_point | integer |
| cartesian_shape | integer |
| date            | integer |
| date_nanos      | integer |
| double          | integer |
| geo_point       | integer |
| geo_shape       | integer |
| geohash         | integer |
| geohex          | integer |
| geotile         | integer |
| integer         | integer |
| ip              | integer |
| keyword         | integer |
| long            | integer |
| text            | integer |
| unsigned_long   | integer |
| version         | integer |


## Example

```esql
ROW a=["foo", "zoo", "bar"]
| EVAL count_a = MV_COUNT(a)
```


| a:keyword             | count_a:integer |
|-----------------------|-----------------|
| ["foo", "zoo", "bar"] | 3               |