SheetRocks
Documentation/Formulas/TAKE

TAKE

Returns the first N rows and optionally first N columns from an array. Returns an error if the result would be empty.

Syntax

TAKE(array, n_rows, [n_columns])

Arguments

Argument Description Required
array The array from which to take elements. Required
n_rows The number of rows to take from the beginning. Required
n_columns The number of columns to take from the beginning. If not specified, all columns are included. Optional

Examples

Take first 2 rows from array

=TAKE(A1:C3, 2)
Result ⇒ Array: [["Name","Age","Score"], ["John","25","85"]]
A B C
1 Name Age Score
2 John 25 85
3 Jane 30 92

Take first 2 rows and first 2 columns

=TAKE(A1:C3, 2, 2)
Result ⇒ Array: [["Name","Age"], ["John","25"]]
A B C
1 Name Age Score
2 John 25 85
3 Jane 30 92

Take single row with all columns

=TAKE(A1:D1, 1)
Result ⇒ Array: [["Apple","Banana","Cherry","Date"]]
A B C D
1 Apple Banana Cherry Date

Related Functions

Other Data functions:


← Back to Formula Reference