Functions
ARRAY_CONSTRAIN
Constrains an array to a given number of rows and columns
Try it
When to use it
When should I use ARRAY_CONSTRAIN?
Use ARRAY_CONSTRAIN to limit an array to a specific number of rows and columns, useful when you only need a subset of a larger computed array.
Used in
Syntax
ARRAY_CONSTRAIN(input, num_rows, num_cols)Examples
=ARRAY_CONSTRAIN({1,2,3;4,5,6;7,8,9},2,2) // => 1
=ARRAY_CONSTRAIN({10,20;30,40},1,1) // => 10
=ARRAY_CONSTRAIN({1,2;3,4},2,2) // => 1