Syntax
=MAKEARRAY(rows, columns, lambda)Arguments
| Argument | Required | Description |
|---|---|---|
rows | Required | Number of rows |
columns | Required | Number of columns |
lambda | Required | LAMBDA(row, column) |
How to use MAKEARRAY
When MAKEARRAY returns more than one value, the result spills into the cells below and to the right. Keep those cells empty, or you get #SPILL!.
MAKEARRAY takes 3 required arguments. Type =MAKEARRAY( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=MAKEARRAY(2, 2, LAMBDA(r, c, r*c))Result Spilled result
| A | B | |
|---|---|---|
| 1 | 1 | 2 |
| 2 | 2 | 4 |
Related array functions
- FILTERReturns the rows (or columns) of a range or array that meet a condition.
- FLATTENPuts the values of one or more ranges into a single column, reading row by row.
- GROUPBYGroups rows by the values of one or more columns and aggregates the values of each group.
- HSTACKPlaces arrays side by side; shorter columns are padded with #N/A.
- MAPApplies a LAMBDA to each value of one or more arrays and returns the results.
- PERCENTOFReturns the sum of a subset of values as a fraction of the sum of all values.
- PIVOTBYSummarizes data by row and column fields and aggregates the values at each intersection.
- QUERYRuns a query (select, where, group by, order by, limit, offset, label) over a range with optional header rows.
- REDUCEReduces an array to one value by applying a LAMBDA to an accumulator and each value.