ReferenceFunctionsLookup Functions
CHOOSEROWS
CHOOSEROWS: Returns selected rows from an array or range.
Summary
CHOOSEROWS builds a new spilled array containing only the requested rows, in the
order provided.
Remarks
- Row indexes are 1-based; negative indexes count from the end (
-1is last row). - Repeated indexes are allowed and duplicate rows in the output.
- Index
0or out-of-bounds indexes return#VALUE!. - The result spills as an array unless it collapses to a single cell.
Examples
Pick first and last rows
Grid
| Cell | Value | |
|---|---|---|
Formula
=
Result
Not evaluated yet.
Expected
[["Jan"],["Mar"]]
Duplicate a row in output
Grid
| Cell | Value | |
|---|---|---|
Formula
=
Result
Not evaluated yet.
Expected
[[9],[9]]
Related functions
FAQ
Can I return rows in a custom order?
Yes. CHOOSEROWS returns rows in the exact order of the supplied indexes, and repeated indexes duplicate rows.
When does CHOOSEROWS return #VALUE!?
It returns #VALUE! for index 0 and for row indexes outside the source height after applying negative-index conversion.
Runtime metadata
Category
Lookup
Signature
CHOOSEROWS(arg1: Range | Any (Range), arg2…: Number)Arity
min 2, max variadic
Arguments
arg1Range | Any · Range
arg2repeating 1Number · Scalar · coercion NumberLenientText
Caps
PURELOOKUP
Source