TAKE function
Returns a given number of rows and/or columns from the start or end of a range or array.
Available in Microsoft 365, Excel 2024, Excel for the web, Excel for Mac 2024+
Excel 2024 and laterNot in Google Sheets
Syntax
TAKE(array, rows, [columns])| Argument | What it means | |
|---|---|---|
array | Required | The range or array to take from. |
rows | Required | How many rows to keep. Positive takes from the top, negative from the bottom. Leave empty to keep all rows. |
columns | Optional | How many columns to keep. Positive takes from the left, negative from the right. |
Returns: The first or last rows/columns of array, which spill.
How TAKE works
TAKE keeps the first or last few rows or columns of a range. Ask for 3 and you get the top three; ask for -3 and you get the bottom three. It is the cleanest way to build top-N reports when wrapped around SORT, and the easiest way to work with "the last few months" when wrapped inside SUM or AVERAGE.
If you ask for more rows than exist, TAKE simply returns everything rather than an error. Because it does not need to know the size of the data, a rolling total such as SUM(TAKE(B2:B100, -3)) keeps working as new months are added - as long as the range does not include blank rows at the end; combine it with TRIMRANGE or a formatted table for that. Its opposite is DROP.
Examples
1First three rows
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Month | Sales | |||
| 2 | Jan | 8200 | Jan | 8200 | |
| 3 | Feb | 9150 | Feb | 9150 | |
| 4 | Mar | 10400 | Mar | 10400 | |
| 5 | Apr | 9800 | |||
| 6 | May | 11250 | |||
| 7 | Jun | 12030 |
The first quarter: January to March.
2Last two rows
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Month | Sales | |||
| 2 | Jan | 8200 | May | 11250 | |
| 3 | Feb | 9150 | Jun | 12030 | |
| 4 | Mar | 10400 | |||
| 5 | Apr | 9800 | |||
| 6 | May | 11250 | |||
| 7 | Jun | 12030 |
Negative rows count from the bottom: May and June.
3Rolling 3-month total
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | Sales | ||
| 2 | Jan | 8200 | 33080 | |
| 3 | Feb | 9150 | ||
| 4 | Mar | 10400 | ||
| 5 | Apr | 9800 | ||
| 6 | May | 11250 | ||
| 7 | Jun | 12030 |
Result: 33080
TAKE returns April to June and SUM adds them: 9800 + 11250 + 12030.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#CALC! | rows or columns is 0, so the result would be empty. | Use a non-zero number or leave the argument out. |
#SPILL! | The output area is blocked. | Clear the cells where the result spills. |
Tips
=TAKE(SORT(A2:B7, 2, -1), 3)lists the three best months.- Use TAKE on a formatted table column (
Sales[Amount]) so new rows are automatically included.
Google Sheets
Use ARRAY_CONSTRAIN(range, rows, columns) for the first rows, or CHOOSEROWS with negative numbers for the last rows.
TAKE in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | VZÍT |
| Danish | TAG |
| Dutch | NEMEN |
| Finnish | OTA |
| French | PRENDRE |
| German | ÜBERNEHMEN |
| Hungarian | ÁTHELYEZ |
| Italian | INCLUDI |
| Norwegian (Bokmål) | TA |
| Polish | WYCINEK |
| Russian | ВЗЯТЬ |
| Spanish | TOMAR |
| Swedish | TA |
| Turkish | AL |
Recipes that use TAKE
- How to find the last value in a column in Excel
- How to list the top 5 values with names in Excel
- How to pick a random sample from a list in Excel