Get a subset of an array
=TAKE(array, [rows], [col])
| Parameter | Description |
|---|---|
array |
The source array or range. |
rows |
[optional] Number of rows to return as an integer. |
col |
[optional] Number of columns to return as an integer. |
To use TAKE, provide an array or range, and a value for rows and/or columns:
=TAKE(array,3) // get first 3 rows
=TAKE(array,,3) // get first 3 columns
=TAKE(array,3,2) // get first 3 rows and 2 columns
To get rows or columns from the start of a range or array, provide positive numbers for rows and columns. In the worksheet below, the formula in F3 is
=TAKE(B3:D11,3)
The TAKE function returns the first 3 rows from B3:D11. The formula in F8 is:
=TAKE(B3:D11,4,2)
When negative numbers are provided for rows or columns, the TAKE function returns values from the end of the array. In the worksheet below, the first
=TAKE(B3:D11,-3)
The formula in F8 returns the last 2 columns of the last 4 rows:
=TAKE(B3:D11,-4,-2)
To return the last complete column or row with TAKE, you can use formulas like this:
=TAKE(array,-1) // last row
=TAKE(array,,-1) // last column