CHOOSEROWS picks rows out of a range or array by position. Name the rows you want and they come back in that order. It is the row-wise partner of CHOOSECOLS.
The arguments
- array is the block to choose from.
- row_num1, row_num2, … are positions inside that block, counted from 1. In
A2:C9, 1 is row 2 of the sheet. A negative number counts back from the bottom: -1 is the last row and -2 the one above it.
The result has one row for each number you give. =CHOOSEROWS(A2:C9,1,3) returns the first and third data rows. Numbers can also come from an array constant such as {1,3,5}, or from SEQUENCE.
First and last rows
The last row of a list that grows is the classic job. =CHOOSEROWS(A2:C100,-1) always returns the final row of the block. For a list that can end before row 100, wrap the range in a FILTER that drops the blanks first, so that -1 lands on real data: =CHOOSEROWS(FILTER(A2:C100,A2:A100<>""),-1).
To return the first and last rows together, write =CHOOSEROWS(A2:C9,1,-1).
Picking rows with SEQUENCE
SEQUENCE builds the row numbers for you. =CHOOSEROWS(A2:C9,SEQUENCE(4,1,1,2)) takes rows 1, 3, 5 and 7: every second row. =CHOOSEROWS(A2:C9,SEQUENCE(3,1,-1,-1)) takes -1, -2 and -3, which is the last three rows with the newest first.
Combining it with SORT
To return the top or bottom rows of a ranked list, sort first and then choose: =CHOOSEROWS(SORT(A2:C9,3,-1),1,2,3) returns the three weeks with the most orders. TAKE does the same for a run of rows from the top or bottom and is shorter when the rows are consecutive. CHOOSEROWS is the right choice when the rows aren't next to each other, when you want them in a particular order, or when you want a row twice.
Errors
A row number of 0, or one beyond the height of the array, returns #VALUE!. In an 8-row array, both 9 and -9 fail.
How it differs from INDEX
INDEX(A2:C9,3,0) returns one row, and choosing several needs an array of numbers. CHOOSEROWS is built for the job. The result is a spilled array of values, so if the cells below and beside the formula are occupied, you get #SPILL!.
CHOOSEROWS needs Microsoft 365, Excel 2024 or later, or Excel for the web.