# FILTER

array · from excel · excel: verified match · sheets: verified match

returns the rows or columns of a range that meet a condition

## signature

```
FILTER(array, include, [if_empty])
```

returns: `array`

## arguments

- array: range — required
- include: range — required
- if_empty: any — optional

## examples

formula and result, asserted in the engine test suite.

| formula | result | with |
| --- | --- | --- |
| `=FILTER(A1:B5, B1:B5>3, "none")` | `20` | A1=10, A2=20, A3=30, A4=40, A5=50, B1=2, B2=4, B3=6, B4=8, B5=10 |

## errors

error values observed from the engine — each with a call that produces it.

| error | produced by |
| --- | --- |
| `#CALC!` | `=FILTER(A1:B2,{FALSE,FALSE})` |
| `#ERROR!` | `=FILTER(A2:A3)` |

## related

- [ARRAY_CONSTRAIN](https://deepcalc.com/functions/array-constrain.md) — truncates a range to at most the given rows and columns
- [ARRAYFORMULA](https://deepcalc.com/functions/arrayformula.md) — evaluates an expression across a range (this engine already spills, so it is a pass-through for sheets compatibility)
- [ARRAYTOTEXT](https://deepcalc.com/functions/arraytotext.md) — converts array to text representation
- [BYCOL](https://deepcalc.com/functions/bycol.md) — applies lambda to each column of array
- [BYROW](https://deepcalc.com/functions/byrow.md) — applies lambda to each row of array
- [CHOOSECOLS](https://deepcalc.com/functions/choosecols.md) — returns the specified columns from an array
- [CHOOSEROWS](https://deepcalc.com/functions/chooserows.md) — returns the specified rows from an array
- [DROP](https://deepcalc.com/functions/drop.md) — removes rows or columns from the start or end of an array

## navigate

- [all array functions](https://deepcalc.com/functions/array-functions.md)
- [function index](https://deepcalc.com/functions.md) — all 600 functions
- [error values](https://deepcalc.com/errors.md) · [concepts](https://deepcalc.com/concepts.md) · [limits](https://deepcalc.com/limits.md)
- [everything in one file](https://deepcalc.com/llms-full.txt)

source: https://deepcalc.com/functions/filter