# FILTER formula generator

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

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

FILTER returns only the rows of a range that pass a test, such as every order from the West region.

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

## Tested FILTER examples

### Filter out rows with a certain value

`=FILTER(A2:D9,C2:C9<>G1)`

Excel. Result on the sample sheet: 5 rows (F3:I7). [See it and try it](https://spreadsheetpractice.com/formulas/filter-out-rows-with-a-certain-value)

### Filter rows based on a condition with a formula

`=FILTER(A2:C10,B2:B10=G1)`

Excel. Result on the sample sheet: 5 rows (G4:I8). [See it and try it](https://spreadsheetpractice.com/formulas/filter-rows-based-on-criteria)

### Remove blank cells from a list with a formula

`=FILTER(A2:A13,A2:A13<>"")`

Excel. Result on the sample sheet: 7 rows (C2:C8). [See it and try it](https://spreadsheetpractice.com/formulas/remove-blank-cells-from-a-list)

### Use FILTER with multiple conditions

`=FILTER(A2:D11,B2:B11=G1,D2:D11>=G2)`

Google Sheets. Result on the sample sheet: 4 rows (F4:I7). [See it and try it](https://spreadsheetpractice.com/formulas/filter-with-several-conditions)

### Remove blank rows with a formula

`=FILTER(A2:C9,(A2:A9<>"")+(B2:B9<>"")+(C2:C9<>""))`

Excel. Result on the sample sheet: 5 rows (E2:G6). [See it and try it](https://spreadsheetpractice.com/formulas/remove-blank-rows-with-a-formula)

### Filter rows from the last 30 days

`=FILTER(A2:C9,(A2:A9>=F1-F2)*(A2:A9<=F1),"No rows")`

Excel. Result on the sample sheet: 5 rows (E4:G8). [See it and try it](https://spreadsheetpractice.com/formulas/filter-rows-from-the-last-30-days)

### Filter rows with REGEXMATCH

`=FILTER(A2:B10,REGEXMATCH(B2:B10,F1))`

Google Sheets. Result on the sample sheet: 4 rows (E3:F6). [See it and try it](https://spreadsheetpractice.com/formulas/filter-rows-with-regexmatch)

### Count unique values with a condition

`=COUNTUNIQUE(FILTER(B2:B12,C2:C12=F1))`

Google Sheets. Result on the sample sheet: 3. [See it and try it](https://spreadsheetpractice.com/formulas/count-unique-values-with-a-condition)

## Questions

### What does the FILTER formula generator do?

You describe the task in plain English, and it writes the formula, using FILTER 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 FILTER do?

FILTER returns only the rows of a range that pass a test, such as every order from the West region.

### Can I learn to write FILTER 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 FILTER 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.
