ID EN
#Dynamic array

CHOOSEROWS

Excel Functions

Return specific rows from an array

Syntax

EXCEL
=CHOOSEROWS(array, row_num1, [row_num2], ...)

Arguments

Parameter Description
array The array to extract rows from.
row_num1 The numeric index of the first row to return.
row_num2 [optional] The numeric index of the second row to return.

Return Value

Extracted rows in a single array

Details

The Excel CHOOSEROWS function returns specific rows from an array or range. The rows to return are provided as numbers in separate arguments. Each number corresponds to the numeric index of a row in the source array. The result from CHOOSEROWS is always a single array that spills onto the worksheet. The first argument in the CHOOSEROWS function is array. Array can be a range, or an array from another formula. Additional arguments are in the form row*_num1*, row*_num2*, row*_num3*, etc. Each number represents a specific row to extract from the array, and should be supplied as a whole number. To get rows 1 and 3 from an array, you can use CHOOSEROWS like this: To get the same two rows in reverse order: CHOOSEROWS will return a #VALUE! error if a requested row number is out of range:

Examples

Basic usage

To get rows 1 and 3 from an array, you can use CHOOSEROWS like this:

EXCEL
=CHOOSEROWS(A1:A5,1,3) // rows 1 and 3
Basic usage

To get the same two rows in reverse order:

EXCEL
=CHOOSEROWS(A1:A5,3,1) // rows 3 and 1
Basic usage

CHOOSEROWS will return a #VALUE! error if a requested row number is out of range:

EXCEL
=CHOOSEROWS(A1:A5,6) // returns #VALUE!
With array constants

Another option for specifying which rows to return is to use an array constant like {1,4,7} as the second argument (row_num1). In the example below, t

EXCEL
=CHOOSEROWS(B3:F9,{1,4,7})
With negative row numbers

A nice feature of CHOOSEROWS is that you can use negative row numbers to extract rows from the end of a range. For example, to get the last row of a r

EXCEL
=CHOOSEROWS(range,-1)
With negative row numbers

To get the second to last row, you can use:

EXCEL
=CHOOSEROWS(range,-2)

See Also

CHOOSECOLS TAKE DROP EXPAND