Array

CHOOSEROWS Formula

Returns specific rows from an array or range by row number. CHOOSEROWS lets you extract and reorder individual rows without OFFSET or INDEX, making it straightforward to pull specific records from a dataset, create sample views, or reverse the row order.

Syntax

CHOOSEROWS(array, row_num1, [row_num2, ...])
ParameterDescription
array Parameter of the CHOOSEROWS function.
row_num1 Parameter of the CHOOSEROWS function.
[row_num2 (Optional.) Parameter of the CHOOSEROWS function.
...] Parameter of the CHOOSEROWS function.
Try CHOOSEROWS in Viztab — free, no signup

Examples

Pick specific records

Formula
=CHOOSEROWS(A1:D100, 1, 5, 10, 25)
Returns 4 rows from the table: the 1st, 5th, 10th, and 25th rows. Useful for creating a curated sample from a large dataset.

Reverse row order

Formula
=CHOOSEROWS(A1:D5, 5, 4, 3, 2, 1)
Returns all 5 rows in reverse order. Row 5 becomes the first row, row 1 becomes the last.

Last row of a dataset

Formula
=CHOOSEROWS(A1:D100, -1)
Returns just the last row. Negative numbers count from the bottom, so -1 is the final row.

Common Errors

#VALUE!

A row number is zero or its absolute value exceeds the total number of rows in the array.

#SPILL!

The output range overlaps with existing non-empty cells.

Tips

Negative row numbers for end-relative access

Use CHOOSEROWS(data, -1, -2, -3) to get the last 3 rows in reverse order. No need to know the total row count.

Create reusable templates

Use CHOOSEROWS to pull header row + specific data rows: CHOOSEROWS(data, 1, 10, 20, 30) gives you the header plus 3 specific records.

Combine with SEQUENCE for ranges

=CHOOSEROWS(A1:D100, SEQUENCE(5, 1, 10)) returns rows 10-14. Use SEQUENCE to generate consecutive row numbers dynamically.

Try CHOOSEROWS in Viztab

Import your data and use CHOOSEROWS with 370+ other formulas. No signup required.

Open Viztab

Related Formulas