Dynamic arrays
TAKE function: slice the first N or last N rows from a table
Keep a contiguous block of rows or columns from the start or end of a range—or pair TAKE with SORT for clean Top-N summaries.
Positive counts slice from the top; negative counts slice from the bottom
TAKE(array, rows, [columns]) returns a contiguous slice of an array. Positive rows (such as 3) take from the top; negative rows (such as -2) take the most recent entries from the bottom. Omitting columns keeps every column.
Pairing TAKE with SORT—such as TAKE(SORT(A2:B6, 2, -1), 3)—creates a live Top-3 table without helper ranks.
| Day (A) | Tickets (B) |
|---|---|
| Mon | 48 |
| Tue | 52 |
| Wed | 39 |
| Thu | 61 |
| Fri | 55 |
Summarize opening days, trailing days, or Top-N peaks
SUM(TAKE(B2:B6, 3)) totals Monday through Wednesday (48 + 52 + 39 = 139), while AVERAGE(TAKE(B2:B6, -2)) averages the last two days (61 and 55 -> 58).
=SUM(TAKE(B2:B6, 3))Zero rows or columns returns #CALC!
Requesting 0 rows or 0 columns asks for an empty array, which returns #CALC!. Requesting more rows than exist safely returns the entire array without error.
=AVERAGE(TAKE(B2:B6, -2))Try the example
Use the original values or change them to test your understanding.