ID EN
#Dynamic array

TAKE

Excel Functions

Get a subset of an array

Syntax

EXCEL
=TAKE(array, [rows], [col])

Arguments

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.

Return Value

A subset of a given array

Details

The TAKE function returns a subset of a given array. The size of the array returned is determined by separate rows and columns arguments. When positive numbers are provided for rows or columns, TAKE will retrieve values from the start or top of the array. Negative numbers take values from the end or bottom of the array. The TAKE function takes three arguments: array, rows, and columns. Array is required, along with at least one value for rows or columns. Array can be a range or an array from another formula. Rows and columns can be negative or positive integers. Positive numbers take values from the start of the array; negative numbers take values from the end of the array. Both rows and columns default to total rows and columns. If no value is supplied, TAKE will return all rows/columns i

Examples

Basic usage

To use TAKE, provide an array or range, and a value for rows and/or columns:

EXCEL
=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
Take from start

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

EXCEL
=TAKE(B3:D11,3)
Take from start

The TAKE function returns the first 3 rows from B3:D11. The formula in F8 is:

EXCEL
=TAKE(B3:D11,4,2)
Take from end

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

EXCEL
=TAKE(B3:D11,-3)
Take from end

The formula in F8 returns the last 2 columns of the last 4 rows:

EXCEL
=TAKE(B3:D11,-4,-2)
Last column or row

To return the last complete column or row with TAKE, you can use formulas like this:

EXCEL
=TAKE(array,-1) // last row
=TAKE(array,,-1) // last column

See Also

DROP CHOOSEROWS CHOOSECOLS EXPAND