---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/function-ref/ARR_INDEX_OF
  - ru/function-ref/ARR_INDEX_OF
  - href: en/function-ref/ARR_INDEX_OF.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/function-ref/ARR_INDEX_OF.html
editable: false
vcsPath: en/function-ref/ARR_INDEX_OF.md
---

# ARR_INDEX_OF



#### Syntax {#syntax}


```
ARR_INDEX_OF( array, value )
```

#### Description {#description}
Returns the position (index) of the first occurrence of the value `value` in the array `array`. The indexing starts from 1. If the value `value` is not found in the array, the function returns 0.

**Argument types:**
- `array` — `Array of fractional numbers | Array of integers | Array of strings`
- `value` — `Fractional number | Integer | String`


**Return type**: `Integer`

#### Examples {#examples}

```
ARR_INDEX_OF(ARRAY('a', 'b', 'c', 'b'), 'b') = 2
```

```
ARR_INDEX_OF(ARRAY(1.1, 2.2, 3.3, 3.3), 3) = 3
```

```
ARR_INDEX_OF(ARRAY(1, 2, 3, 2), 2) = 2
```

```
ARR_INDEX_OF(ARRAY('a', 'b', 'c', 'b'), 'd') = 0
```


#### Data source support {#data-source-support}

`ClickHouse 21.8`, `Files`, `Google Sheets`, `PostgreSQL 9.3`, `Trino`, `Yandex Documents`.
