FILTER

returns the rows or columns of a range that meet a condition · from excel · excel: verified match · sheets: verified match

signature

FILTER(array, include, [if_empty])

returns: array

argumentrequired
array required
include required
if_empty optional

examples

formula and result, taken from the engine's own test suite — every result below is asserted in CI, not written by hand.

AB
1 102
2 204
3 306
4 408
5 5010
fx =FILTER(A1:B5, B1:B5>3, "none") 20

errors

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

errorproduced by
#CALC! =FILTER(A1:B2,{FALSE,FALSE})
#ERROR! =FILTER(A2:A3)

related

  • ARRAY_CONSTRAIN truncates a range to at most the given rows and columns
  • ARRAYFORMULA evaluates an expression across a range (this engine already spills, so it is a pass-through for sheets compatibility)
  • ARRAYTOTEXT converts array to text representation
  • BYCOL applies lambda to each column of array
  • BYROW applies lambda to each row of array
  • CHOOSECOLS returns the specified columns from an array