# TAKE formula generator

> Describe what you need and get a TAKE formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested TAKE examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/take · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

TAKE keeps the first or last rows (and columns) of a range and drops the rest.

Describe the task at [TAKE formula generator](https://spreadsheetpractice.com/tools/formula-generator/take) and get a TAKE formula for Excel and Google Sheets, tested on real data.

## Tested TAKE examples

### Get the last N rows of a table

`=TAKE(A2:C9,-3)`

Excel. Result on the sample sheet: 3 rows (E2:G4). [See it and try it](https://spreadsheetpractice.com/formulas/get-the-last-n-rows-of-a-table)

### Get the top 3 rows by value

`=TAKE(SORT(A2:B8,2,-1),3)`

Excel. Result on the sample sheet: 3 rows (D2:E4). [See it and try it](https://spreadsheetpractice.com/formulas/top-n-rows)

### Return the first 3 matches with FILTER

`=TAKE(FILTER(A2:C12,B2:B12=F1),F2)`

Excel. Result on the sample sheet: 3 rows (E4:G6). [See it and try it](https://spreadsheetpractice.com/formulas/return-the-first-n-matches)

### Get the last 3 entries for a customer

`=TAKE(FILTER(A2:C12,B2:B12=F1),-3)`

Excel. Result on the sample sheet: 3 rows (E3:G5). [See it and try it](https://spreadsheetpractice.com/formulas/last-3-entries-for-a-customer)

### Sum up to a selected month

`=SUM(TAKE(B2:M2,,MATCH($P$1,$B$1:$M$1,0)))`

Excel. Result on the sample sheet: 4 rows (N2:N5). [See it and try it](https://spreadsheetpractice.com/formulas/sum-up-to-a-selected-month)

### Sum the last N values in a column

`=SUM(TAKE(FILTER(B2:B13,B2:B13<>""),-E1))`

Excel. Result on the sample sheet: 1546. [See it and try it](https://spreadsheetpractice.com/formulas/sum-the-last-n-values)

### Average the last N values

`=AVERAGE(TAKE(FILTER(B2:B11,B2:B11<>""),-E1))`

Excel. Result on the sample sheet: 86.00. [See it and try it](https://spreadsheetpractice.com/formulas/average-the-last-n-values)

### Sum until the first blank cell

`=SUM(TAKE(B2:B9,XMATCH(TRUE,B2:B9="")-1))`

Excel. Result on the sample sheet: $6,005. [See it and try it](https://spreadsheetpractice.com/formulas/sum-until-the-first-blank-cell)

## Questions

### What does the TAKE formula generator do?

You describe the task in plain English, and it writes the formula, using TAKE where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does TAKE do?

TAKE keeps the first or last rows (and columns) of a range and drops the rest.

### Can I learn to write TAKE formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the TAKE function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
