TAKE
Returns a subset from the start or end of rows and optional columns.
TAKE extracts leading or trailing portions of an array based on signed counts.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=TAKE(array, rows, [columns])
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
array | range (range) | Required | — |
rows | number | Required | — |
columns | number | Optional | — |
Remarks
- Positive counts take from the start; negative counts take from the end.
rowsis required;columnsis optional.- Empty selections return an empty spill.
Error cases
- Absolute counts larger than the source dimension return
#VALUE!.
Examples
Return the first two rows of a three-row array.
Formula =TAKE({1,2;3,4;5,6},2)
Expected result {1, 2; 3, 4}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Return the last two rows and the last column.
Formula =TAKE({1,2;3,4;5,6},-2,-1)
Expected result {4; 6}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Take one row and one column to return a single cell.
Formula =TAKE({1,2;3,4},1,1)
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The rows argument must give a numeric count.
Formula =TAKE({1,2;3,4},"two")
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Take top two rows
Formula =TAKE(A1:A3,2)
| A | |
|---|---|
| 1 | 10 |
| 2 | 20 |
| 3 | 30 |
Expected result {10; 20}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Take last row and last two columns
Formula =TAKE(A1:C2,-1,-2)
| A | B | C | |
|---|---|---|---|
| 1 | 1 | 2 | 3 |
| 2 | 4 | 5 | 6 |
Expected result {5, 6}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
How are negative rows or columns interpreted?
Negative counts take from the end of the array, so TAKE(...,-1) returns the last row and TAKE(...,,-1) returns the last column.
When does TAKE return #VALUE!?
If the absolute requested row or column count exceeds source dimensions, TAKE returns #VALUE!.