Dynamic arrays function
TAKE function in Excel
TAKE returns the first (or last) rows or columns of a range or array.
Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet
- Excel 2016
- Excel 2019
- Excel 2021
- Excel 2024
- Microsoft 365
- Google Sheets
Syntax
TAKE(array, rows, [columns])Arguments in [brackets] are optional. Google Sheets doesn't have this function.
Example
=TAKE(SORTBY(A2:A9,C2:C9,-1),3) reads: Sort the reps by July sales, highest first, and keep the first 3 rows.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Rep | Region | Jul | Aug | Sep | Target | Top 3 Jul | |
| 2 | Amara Osei | North | $12,400 | $13,100 | $11,800 | $36,000 | Lina Chen | |
| 3 | Ben Fischer | South | $9,800 | $10,250 | $12,100 | $30,000 | Hugo Martin | |
| 4 | Lina Chen | East | $15,200 | $14,800 | $16,900 | $45,000 | Farid Haddad | |
| 5 | Diego Alvarez | West | $8,700 | $9,100 | $8,400 | $28,000 | ||
| 6 | Eva Novak | North | $11,200 | $12,600 | $13,900 | $36,000 | ||
| 7 | Farid Haddad | South | $13,300 | $12,900 | $14,100 | $39,000 | ||
| 8 | Grace Kim | East | $10,100 | $9,600 | $10,800 | $33,000 | ||
| 9 | Hugo Martin | West | $14,500 | $15,800 | $15,100 | $42,000 |
H2 to H4 show Lina Chen, Hugo Martin and Farid Haddad: the top three Julys.
How the spreadsheet calculates it
Keeps the first 3 row(s) of the result of SORTBY (step 1) (negative: the last ones).
- 1. SORTBY: Sorts
A2:A9by the values inC2:C9, largest first, and spills the result.array=`A2:A9`: what to returnby_range=`C2:C9`: what to sort byorder=`-1`: `1` ascending, `-1` descending
- 2. TAKE: Keeps the first
3row(s) of the result of step 1 (negative: the last ones).array=the result of step 1: the result to cut, like a SORTBYn=`3`: how many rows to keep from the top
More TAKE examples
=TAKE(SORTBY(A2:A9,C2:C9,-1),3)The top three reps by July sales.=TAKE(A2:C100,-5)The last five rows.=TAKE(A2:E9,,2)The first two columns of every row.
Paste any of these into the formula explainer to see it step by step.
Tips
- Sort before you take: TAKE keeps rows in the order it receives them.
- Use a negative count to take from the end, such as the latest rows of a log.
- Combine it with FILTER and SORTBY for a top N within a group.
- Leave room below the formula for the rows it returns.
What TAKE is used for
Top-N and bottom-N lists in dashboards, the last few rows of a growing log, and trimming a long dynamic-array result to what fits a report.
Arguments
| Argument | Required | What it is |
|---|---|---|
| array | Yes | The range or array to take from, often another dynamic-array formula. |
| rows | Yes | How many rows to keep from the top; a negative number keeps rows from the bottom. |
| columns | No | How many columns to keep from the left; negative from the right. |
Common mistakes
Using it in Google Sheets or Excel 2021: #NAME?.
Using it in Google Sheets or Excel 2021 or older, which don't have TAKE.
Taking from an unsorted range and calling it a top three.
In Google Sheets
Google Sheets doesn't have TAKE (it's missing from Google's function list). Google's list does include ARRAY_CONSTRAIN(input_range, num_rows, num_cols), which cuts a result down to a size; we haven't tested it on this site, so check Google's help before relying on it.
Errors you may see with TAKE
Questions
TAKE or DROP?
TAKE keeps the first or last rows; DROP removes them and keeps the rest.
What works in older Excel?
LARGE with INDEX MATCH: see the top N section of SUMPRODUCT and summary grids.
What happens if I ask for more rows than there are?
Microsoft's TAKE page doesn't promise an error; we haven't confirmed the exact behaviour, so keep the count within the data.
Sources
Official documentation the facts on this page were checked against.