Skip to content

TAKE

Returns a set number of rows or columns from the start or end of a range or array. Negative numbers take from the end.

Syntax

=TAKE(, , )

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 F2 or change the inputs. The sheet recalculates as you type.

F2
A
B
C
D
E
F
G
H
1
Dept
Q1
Q2
Q3
2
Ops
120
135
128
Ops
120
135
3
Sales
210
190
225
Sales
210
190
4
IT
95
110
105
IT
95
110
5
HR
60
58
64
6
Legal
75
80
70
7

F2 =TAKE(A2:D6,3) returns Ops, 120, 135, 128; Sales, 210, 190, 225; IT, 95, 110, 105

How TAKE works

TAKE keeps a block from the edge of an array: the first few rows, the last few, the left columns, or the right columns. It is the formula version of "show me the top 5".

The arguments

  • array is the data to take from.
  • rows is how many rows to keep. Positive keeps rows from the top, negative from the bottom. =TAKE(A2:D6,3) returns the first three rows, and =TAKE(A2:D6,-2) the last two.
  • columns is how many columns to keep. Positive keeps columns from the left, negative from the right. =TAKE(A2:D6,,2) keeps all rows but only the first two columns. The empty slot for rows is deliberate.

Give both and you take a corner. =TAKE(A2:D6,2,-2) returns the first two rows of the last two columns.

If you ask for more rows or columns than the array has, TAKE returns everything it has and doesn't raise an error. A count of 0 is an error and returns #CALC!, because the result would be empty.

Top N and bottom N

TAKE becomes useful when you combine it with SORT. Sort the table first, then take from the top:

=TAKE(SORT(A2:D6,4,-1),3)

This returns the three departments with the highest Q3. Use -3 with an ascending sort to get the same result the other way round. Because SORT and TAKE are formulas, the top three update when the data does.

The latest values

=TAKE(A2:B100,-5) returns the last five rows of a list. It only works as the "latest five" when the list has no blank rows at the bottom, so keep the range tight, or wrap it in a FILTER that drops blanks, as in =TAKE(FILTER(A2:B100,A2:A100<>""),-5).

TAKE, DROP and CHOOSEROWS

TAKE keeps a run from an edge. DROP removes a run from an edge, so TAKE(array,-3) and DROP(array,ROWS(array)-3) agree. CHOOSEROWS and CHOOSECOLS pick rows or columns that aren't together, in any order. Use TAKE for the simple edge case: it is shorter and reads better.

Spilling

The result spills into the cells below and to the right. If the area isn't empty, you get #SPILL!. You can read the whole result in another formula with the spill operator, such as =SUM(F2#). See FILTER for more.

TAKE needs Microsoft 365, Excel 2024 or later, or Excel for the web. In earlier versions it returns #NAME?, and INDEX with a range such as A2:INDEX(A:A,5) does a similar job.

Arguments

array
The range or array to take from. It can be the result of another formula, such as SORT(...).
rows
How many rows to keep. A positive number takes rows from the top, a negative number takes them from the bottom. Leave it empty to keep all rows, as in TAKE(A2:D6,,2).
columnsoptional
How many columns to keep. A positive number takes columns from the left, a negative number from the right. Leave it out to keep all columns.

Examples

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

Example 1

The first three rows

F2 =TAKE(A2:D6,3)

Result: Ops, 120, 135, 128; Sales, 210, 190, 225; IT, 95, 110, 105

A positive number takes rows from the top.

F2
A
B
C
D
E
F
G
H
1
Dept
Q1
Q2
Q3
2
Ops
120
135
128
Ops
120
135
3
Sales
210
190
225
Sales
210
190
4
IT
95
110
105
IT
95
110
5
HR
60
58
64
6
Legal
75
80
70
7

F2 =TAKE(A2:D6,3) returns Ops, 120, 135, 128; Sales, 210, 190, 225; IT, 95, 110, 105

Example 2

The last two rows

F2 =TAKE(A2:D6,-2)

Result: HR, 60, 58, 64; Legal, 75, 80, 70

A negative number takes rows from the bottom.

F2
A
B
C
D
E
F
G
H
1
Dept
Q1
Q2
Q3
2
Ops
120
135
128
HR
60
58
3
Sales
210
190
225
Legal
75
80
4
IT
95
110
105
5
HR
60
58
64
6
Legal
75
80
70
7

F2 =TAKE(A2:D6,-2) returns HR, 60, 58, 64; Legal, 75, 80, 70

Example 3

Only the first two columns

F2 =TAKE(A2:D6,,2)

Result: Ops, 120; Sales, 210; IT, 95; HR, 60; Legal, 75

The empty rows argument keeps all five rows. The 2 in the third position keeps the two leftmost columns.

F2
A
B
C
D
E
F
G
H
1
Dept
Q1
Q2
Q3
2
Ops
120
135
128
Ops
120
3
Sales
210
190
225
Sales
210
4
IT
95
110
105
IT
95
5
HR
60
58
64
HR
60
6
Legal
75
80
70
Legal
75
7

F2 =TAKE(A2:D6,,2) returns Ops, 120; Sales, 210; IT, 95; HR, 60; Legal, 75

Example 4

A corner: first two rows, last two columns

F2 =TAKE(A2:D6,2,-2)

Result: 135, 128; 190, 225

Rows 1 and 2 of the table, and its last two columns, Q2 and Q3.

F2
A
B
C
D
E
F
G
H
1
Dept
Q1
Q2
Q3
2
Ops
120
135
128
135
128
3
Sales
210
190
225
190
225
4
IT
95
110
105
5
HR
60
58
64
6
Legal
75
80
70
7

F2 =TAKE(A2:D6,2,-2) returns 135, 128; 190, 225

Example 5

Top 3 by Q3 with SORT

F2 =TAKE(SORT(A2:D6,4,-1),3)

Result: Sales, 210, 190, 225; Ops, 120, 135, 128; IT, 95, 110, 105

SORT puts the departments in descending order of Q3, the fourth column. TAKE keeps the top three.

F2
A
B
C
D
E
F
G
H
1
Dept
Q1
Q2
Q3
2
Ops
120
135
128
Sales
210
190
3
Sales
210
190
225
Ops
120
135
4
IT
95
110
105
IT
95
110
5
HR
60
58
64
6
Legal
75
80
70
7

F2 =TAKE(SORT(A2:D6,4,-1),3) returns Sales, 210, 190, 225; Ops, 120, 135, 128; IT, 95, 110, 105

Your turn.

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

Task 1 of 2

In F2, show the three reps with the highest revenue, all four columns, highest first.

Answer in F2.

F2
A
B
C
D
E
F
G
H
I
1
Rep
Region
Deals
Revenue
2
R-01
North
8
42,000
3
R-02
South
5
31,500
4
R-03
East
11
58,200
5
R-04
West
6
36,800
6
R-05
North
9
47,100
7
R-06
South
4
24,900
8
R-07
East
7
39,400
9
10
11
12
13
14
15
16
17
18

Common mistakes

  • A row count of 0 gives #CALC!, because the result would be empty. If the count comes from a cell, guard it with MAX(1,B1).
  • The empty slot matters. TAKE(A2:D6,2) keeps two rows, but TAKE(A2:D6,,2) keeps two columns. The missing rows argument still needs its comma.
  • Asking for more rows than exist does not raise an error. TAKE returns all of them, so a report that expects exactly five rows can quietly show three.
  • TAKE with a negative number returns the bottom of the range, which includes any blank rows at the end. Keep the range tight or filter blanks out first.
  • Remember to sort before you take for a top or bottom list. TAKE returns the first rows as they are in the array, and has no sense of which are biggest.

Questions people ask

How do I get the top 5 values in Excel?

Sort first, then take: `=TAKE(SORT(A2:B20,2,-1),5)` returns the five rows with the highest value in column B.

How do I return the last row, or the last N rows?

Use a negative number: `=TAKE(A2:B20,-1)` is the last row and `=TAKE(A2:B20,-5)` the last five. Make sure there are no empty rows at the bottom of the range.

How do I take only some columns with TAKE?

Leave the row count empty and give a column count: `=TAKE(A2:D6,,2)` returns the first two columns. A negative column count takes columns from the right.

What happens if I take more rows than the array has?

TAKE returns every row without an error. If you need to know whether the array is long enough, compare the row count with `ROWS(array)`.

Does TAKE work in Excel 2021 or 2019?

No. It is available in Microsoft 365, Excel 2024 and later, and Excel for the web. In earlier versions the formula returns `#NAME?`.

Learn TAKE in a real sheet.

TAKE is taught in Data analysis with formulas, lesson 13: Combining dynamic arrays. Each lesson is a short, graded exercise like the one above.