# MAKEARRAY

## Content

This function returns a calculated array of a specified row and column size by applying a [LAMBDA](/spreadjs/docs/v17/formulareference/FormulaFunctions/other-functions/lambda-function).

## Syntax

`MAKEARRAY(rows, cols, lambda(row, col))`

## Argument

This function has the following arguments:

| Argument | Description |
| -------- | ----------- |
| *rows* | The number of rows in the array. Must be greater than zero. |
| *cols* | The number of columns in the array. Must be greater than zero. |
| *lambda* | A LAMBDA that is called to create the array.<br>The LAMBDA takes two parameters:<ul><li>row: The row index of the array.</li><li>col: The column index of the array.</li></ul> |

## Remarks

If an invalid LAMBDA function or an incorrect number of parameters are provided, it returns a #VALUE! error called "Incorrect Parameters".

If a row or column argument is set to a value less than 1 or to a non-number, it returns a #VALUE! error.

## Data Types

Returns an array.

## Examples

`MAKEARRAY(3, 3, LAMBDA(r,c, r*c))`
`MAKEARRAY(D2,E2,LAMBDA(row,col,CHOOSE(RANDBETWEEN(1,3),"Red","Blue","Green")))`