Question: Stumbled upon a strange behavior. This formula:

```none
=ARRAYFORMULA(ROW($A$1:$E$5))

```

Returns a 5 element column with the row numbers from 1 to 5. I thought that `ARRAYFORMULA` would iterate through every cell in the range specified and execute the `ROW()` on it - resulting in a new range of the same size (5 columns, 5 rows), but with the row numbers in cells.

For example `=ARRAYFORMULA(ISBLANK($A$1:$E$5))` returns a 5 on 5 range.

[![enter image description here](https://i.stack.imgur.com/YRuew.png)](https://i.stack.imgur.com/YRuew.png)

I found a way to force the desired behavior (see the answer below), but is there a better way? Am I missing something?

Answer: 
not rly much to say here just that `ROW` and `COLUMN` are only one dimensional. in other words, `ROW` will work only with one single column and `COLUMN` will work only with one single row - no matter that you feed it with range **A1:Z** or **A1:A**

as mentioned you can use MattKing's `SEQUENCE` to generate the matrix

or shorter:

```
=ARRAYFORMULA(ROW(A1:A5)*COLUMN(A:E)^0)

```

[![enter image description here](https://i.stack.imgur.com/7Z7VV.png)](https://i.stack.imgur.com/7Z7VV.png)

or shorter:

```
=INDEX(ROW(A1:A5)*COLUMN(A:E)^0)

```

or shorter:

```
=INDEX(ROW(A1:A5)*{1,1,1,1,1})

```
Here is a workaround for you, man:

```none
=ARRAYFORMULA(ROW($A$1:$E$5) + 0 * ISBLANK(A1:E5))

```

`0 * ISBLANK(A1:E5)` part is there just to force the desired behavior without modifying (see that multiplication by `0`?) the values you need.

[![enter image description here](https://i.stack.imgur.com/Gjy1T.png)](https://i.stack.imgur.com/Gjy1T.png)