formulastreak

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

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.

Q3 sales team · edit H2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultH2 = Lina Chen
ABCDEFGH
1RepRegionJulAugSepTargetTop 3 Jul
2Amara OseiNorth$12,400$13,100$11,800$36,000Lina Chen
3Ben FischerSouth$9,800$10,250$12,100$30,000Hugo Martin
4Lina ChenEast$15,200$14,800$16,900$45,000Farid Haddad
5Diego AlvarezWest$8,700$9,100$8,400$28,000
6Eva NovakNorth$11,200$12,600$13,900$36,000
7Farid HaddadSouth$13,300$12,900$14,100$39,000
8Grace KimEast$10,100$9,600$10,800$33,000
9Hugo MartinWest$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. 1. SORTBY: Sorts A2:A9 by the values in C2:C9, largest first, and spills the result.
    • array = `A2:A9`: what to return
    • by_range = `C2:C9`: what to sort by
    • order = `-1`: `1` ascending, `-1` descending
  2. 2. TAKE: Keeps the first 3 row(s) of the result of step 1 (negative: the last ones).
    • array = the result of step 1: the result to cut, like a SORTBY
    • n = `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

ArgumentRequiredWhat it is
arrayYesThe range or array to take from, often another dynamic-array formula.
rowsYesHow many rows to keep from the top; a negative number keeps rows from the bottom.
columnsNoHow 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

  • #NAME?: The file is open in Google Sheets or Excel 2021 or older.
  • #SPILL!: Something blocks the result.

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.

Practise TAKE on a live sheet

Lesson 39, UNIQUE and SORT (Unit 11, Dynamic arrays), has 6 graded exercises, checked instantly, with steps and hints when you're stuck. Pro