Google Sheets function · Array
CHOOSEROWS in Google Sheets: syntax and examples
CHOOSEROWS builds a new array from the rows you name, in the order you name them. It can reorder, repeat or pick from the end, which a plain range reference cannot.
Syntax
CHOOSEROWS(array, row_num1, [row_num2])
Arguments
| Argument | Type | Required | What it does |
|---|---|---|---|
array | range | yes | The range or array to take rows from. |
row_num1 | number | yes | The first row to return. Negative numbers count from the bottom. |
row_num2, ... | number | no | More rows to return, in the order you list them. |
Examples
The examples use this table, starting in A1:
| Name | City | Qty |
| Ana | Cluj | 3 |
| Dan | Iasi | 5 |
| Mia | Sibiu | 2 |
| Eva | Brasov | 7 |
=CHOOSEROWS(A1:C5,1,3)Result:
| Name | City | Qty |
| Dan | Iasi | 5 |
Rows 1 and 3 of the range: the header and the second record.
Run in a Google Sheet (English US locale) on .
=CHOOSEROWS(A1:C5,-1)Result:
| Eva | Brasov | 7 |
A negative number counts from the end, so -1 is the last row.
Run in a Google Sheet (English US locale) on .
=CHOOSEROWS(A2:C5,3,1)Result:
| Mia | Sibiu | 2 |
| Ana | Cluj | 3 |
The order you type is the order you get: row 3 first, then row 1.
Run in a Google Sheet (English US locale) on .
=CHOOSEROWS(A2:C5,{1;3})Result:
| Ana | Cluj | 3 |
| Mia | Sibiu | 2 |
Row numbers can come from a typed array instead of separate arguments.
Run in a Google Sheet (English US locale) on .
=CHOOSEROWS(SORT(A2:C5,3,FALSE),1,2)Result:
| Eva | Brasov | 7 |
| Dan | Iasi | 5 |
Sort by quantity, then keep the top two rows.
Run in a Google Sheet (English US locale) on .
Common errors
- Row 0 and rows beyond the range return #VALUE!. A range of five rows accepts 1 to 5 and -1 to -5.
- Rows come back in the order you list them, not in sheet order, so CHOOSEROWS(A2:C5,3,1) starts with row 3.
- The same row can be listed twice and then appears twice in the result.
- It picks by position, not by value. To keep rows that meet a condition, use FILTER.
Compared with Excel
Same function and arguments as Excel 365 CHOOSEROWS.