Skip to content

CHOOSEROWS

Returns the rows you name from a range or array, in the order you name them. Negative numbers count from the bottom.

Syntax

=CHOOSEROWS(, , [row_num2], …)

Dynamic arrays

Excel for Microsoft 365, Excel 2024 and later, and Excel for the web. Not available in Excel 2021 or earlier.

Try it

Edit the formula in E2 or change the inputs. The sheet recalculates as you type.

E2
A
B
C
D
E
F
G
1
Week
Visits
Orders
2
Wk 1
1200
96
Wk 1
1200
96
3
Wk 2
1350
108
Wk 3
1100
77
4
Wk 3
1100
77
5
Wk 4
1500
135
6
Wk 5
1420
114
7
Wk 6
1260
88
8
Wk 7
1610
145
9
Wk 8
1380
110
10

E2 =CHOOSEROWS(A2:C9,1,3) returns Wk 1, 1200, 96; Wk 3, 1100, 77

How CHOOSEROWS works

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.

Arguments

array
The range or array to take rows from. It can be the result of another formula, such as SORT(...).
row_num1
The position of the first row to return, counted from 1 within array. A negative number counts from the bottom, so -1 is the last row.
row_num2, …optional
More row numbers. Rows come back in the order you list them, and a row may be repeated.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Pick two rows by position

E2 =CHOOSEROWS(A2:C9,1,3)

Result: Wk 1, 1200, 96; Wk 3, 1100, 77

Rows 1 and 3 of A2:C9 are Wk 1 and Wk 3. They come back in the order you named them.

E2
A
B
C
D
E
F
G
1
Week
Visits
Orders
2
Wk 1
1200
96
Wk 1
1200
96
3
Wk 2
1350
108
Wk 3
1100
77
4
Wk 3
1100
77
5
Wk 4
1500
135
6
Wk 5
1420
114
7
Wk 6
1260
88
8
Wk 7
1610
145
9
Wk 8
1380
110
10

E2 =CHOOSEROWS(A2:C9,1,3) returns Wk 1, 1200, 96; Wk 3, 1100, 77

Example 2

The last row of the table

E2 =CHOOSEROWS(A2:C9,-1)

Result: Wk 8, 1380, 110

-1 counts from the bottom, so this is always the final row of the block, however long it becomes.

E2
A
B
C
D
E
F
G
1
Week
Visits
Orders
2
Wk 1
1200
96
Wk 8
1380
110
3
Wk 2
1350
108
4
Wk 3
1100
77
5
Wk 4
1500
135
6
Wk 5
1420
114
7
Wk 6
1260
88
8
Wk 7
1610
145
9
Wk 8
1380
110
10

E2 =CHOOSEROWS(A2:C9,-1) returns Wk 8, 1380, 110

Example 3

First and last rows together

E2 =CHOOSEROWS(A2:C9,1,-1)

Result: Wk 1, 1200, 96; Wk 8, 1380, 110

Positive and negative numbers can be mixed in the same formula.

E2
A
B
C
D
E
F
G
1
Week
Visits
Orders
2
Wk 1
1200
96
Wk 1
1200
96
3
Wk 2
1350
108
Wk 8
1380
110
4
Wk 3
1100
77
5
Wk 4
1500
135
6
Wk 5
1420
114
7
Wk 6
1260
88
8
Wk 7
1610
145
9
Wk 8
1380
110
10

E2 =CHOOSEROWS(A2:C9,1,-1) returns Wk 1, 1200, 96; Wk 8, 1380, 110

Example 4

Every second row, using SEQUENCE

E2 =CHOOSEROWS(A2:C9,SEQUENCE(4,1,1,2))

Result: Wk 1, 1200, 96; Wk 3, 1100, 77; Wk 5, 1420, 114; Wk 7, 1610, 145

SEQUENCE(4,1,1,2) supplies 1, 3, 5, 7, so CHOOSEROWS returns those four rows.

E2
A
B
C
D
E
F
G
1
Week
Visits
Orders
2
Wk 1
1200
96
Wk 1
1200
96
3
Wk 2
1350
108
Wk 3
1100
77
4
Wk 3
1100
77
Wk 5
1420
114
5
Wk 4
1500
135
Wk 7
1610
145
6
Wk 5
1420
114
7
Wk 6
1260
88
8
Wk 7
1610
145
9
Wk 8
1380
110
10

E2 =CHOOSEROWS(A2:C9,SEQUENCE(4,1,1,2)) returns Wk 1, 1200, 96; Wk 3, 1100, 77; Wk 5, 1420, 114; Wk 7, 1610, 145

Example 5

The last three rows, newest first

E2 =CHOOSEROWS(A2:C9,SEQUENCE(3,1,-1,-1))

Result: Wk 8, 1380, 110; Wk 7, 1610, 145; Wk 6, 1260, 88

The sequence runs -1, -2, -3, which counts up the table from the bottom.

E2
A
B
C
D
E
F
G
1
Week
Visits
Orders
2
Wk 1
1200
96
Wk 8
1380
110
3
Wk 2
1350
108
Wk 7
1610
145
4
Wk 3
1100
77
Wk 6
1260
88
5
Wk 4
1500
135
6
Wk 5
1420
114
7
Wk 6
1260
88
8
Wk 7
1610
145
9
Wk 8
1380
110
10

E2 =CHOOSEROWS(A2:C9,SEQUENCE(3,1,-1,-1)) returns Wk 8, 1380, 110; Wk 7, 1610, 145; Wk 6, 1260, 88

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In D2, return the first and the last month of the table (both columns).

Answer in D2.

D2
A
B
C
D
E
F
G
H
I
1
Month
Revenue
2
Jan
18,200
3
Feb
17,500
4
Mar
21,400
5
Apr
19,800
6
May
22,600
7
Jun
24,100
8

Common mistakes

  • #VALUE! means a row number is 0 or beyond the array. An 8-row array fails on 9, -9 and 0. Count the rows in the block you pass in.
  • Positions count inside array, not by sheet row. For =CHOOSEROWS(A5:C20,1) the 1 returns row 5.
  • If the range includes empty rows at the bottom, -1 returns an empty row. Filter the blanks out first or use an exact range.
  • Inserting or deleting rows inside the range shifts what a fixed row number returns. Count from the bottom with negative numbers, or look the position up with MATCH.
  • The result spills. #SPILL! means something sits in the cells below or to the right of the formula.

Questions people ask

How do I get the last row of a table in Excel?

Use `=CHOOSEROWS(A2:C9,-1)`. A negative number counts from the bottom. For a range with empty rows at the end, filter the blanks out first.

Can CHOOSEROWS return rows in a different order?

Yes. They come back in the order of your numbers. `=CHOOSEROWS(A2:C9,3,1)` returns row 3, then row 1. You can even repeat a row.

What is the difference between CHOOSEROWS and TAKE?

TAKE returns a run of consecutive rows from the top or bottom. CHOOSEROWS returns any rows you name, in any order, including ones from the middle.

How do I return every other row in Excel?

Feed SEQUENCE into CHOOSEROWS: `=CHOOSEROWS(A2:C9,SEQUENCE(4,1,1,2))` returns rows 1, 3, 5 and 7.

Does CHOOSEROWS work in Excel 2021?

No. It is available in Microsoft 365, Excel 2024 and later, and Excel for the web. In Excel 2021 it returns `#NAME?`. INDEX with an array of row numbers can do the same job.

Learn CHOOSEROWS in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.