array functions
work on whole ranges at once and return multiple values.
| function | signature | what it does | tests |
|---|---|---|---|
| ARRAYFORMULA | ARRAYFORMULA(expression) | evaluates an expression across a range (this engine already spills, so it is a pass-through for sheets compatibility) | — |
| ARRAYTOTEXT | ARRAYTOTEXT(array, [format]) | converts array to text representation | — |
| BYCOL | BYCOL(array, lambda) | applies lambda to each column of array | — |
| BYROW | BYROW(array, lambda) | applies lambda to each row of array | — |
| CHOOSECOLS | CHOOSECOLS(array, col_num…) | returns the specified columns from an array | — |
| CHOOSEROWS | CHOOSEROWS(array, row_num…) | returns the specified rows from an array | — |
| DROP | DROP(array, rows, [columns]) | removes rows or columns from the start or end of an array | — |
| EXPAND | EXPAND(array, rows, [columns], [pad_with]) | pads an array to a given size with a fill value | 1 |
| FILTER | FILTER(array, include, [if_empty]) | returns the rows or columns of a range that meet a condition | — |
| HSTACK | HSTACK(array…) | joins arrays side by side into one array | — |
| ISOMITTED | ISOMITTED(argument) | checks if lambda argument is omitted | — |
| LAMBDA | LAMBDA(parameter_or_calculation…) | creates a custom reusable function | — |
| LET | LET(name1, name_value1, calculation_or_more…) | assigns names to values in a formula | — |
| MAKEARRAY | MAKEARRAY(rows, columns, lambda) | creates array from lambda over indices | — |
| MAP | MAP(array, lambda) | maps lambda over array values | — |
| RANDARRAY | RANDARRAY([rows], [columns], [min], [max], [whole_number]) | returns an array of random numbers | — |
| REDUCE | REDUCE(initial_value, array, lambda) | reduces array to value with lambda | — |
| SCAN | SCAN(initial_value, array, lambda) | scans array with lambda keeping intermediates | — |
| SEQUENCE | SEQUENCE(rows, [columns], [start], [step]) | generates a sequence of numbers as an array | — |
| SORT | SORT(array, [sort_index], [sort_order], [by_col]) | sorts the contents of a range or array | 1 |
| SORTBY | SORTBY(array, by_array1, [sort_order1], [by_array2…], [sort_order2…]) | sorts a range or array by values in a corresponding range | — |
| TAKE | TAKE(array, rows, [columns]) | returns rows or columns from the start or end of an array | — |
| TOCOL | TOCOL(array, [ignore], [scan_by_column]) | returns an array as a single column | — |
| TOROW | TOROW(array, [ignore], [scan_by_column]) | returns an array as a single row | — |
| TRANSPOSE | TRANSPOSE(array) | flips the orientation of a range or array | — |
| TRIMRANGE | TRIMRANGE(range, [trim_rows], [trim_cols]) | trims empty rows and columns from the edges of a range | — |
| UNIQUE | UNIQUE(array, [by_col], [exactly_once]) | returns the distinct values from a range or array | 1 |
| VSTACK | VSTACK(array…) | stacks arrays on top of each other into one array | — |
| WRAPCOLS | WRAPCOLS(vector, wrap_count, [pad_with]) | wraps a row or column into a 2-D array by columns | — |
| WRAPROWS | WRAPROWS(vector, wrap_count, [pad_with]) | wraps a row or column into a 2-D array by rows | — |