FILTER

Returns a filtered array containing only rows that match the criteria

Syntax

FILTER(array, criteria)

Arguments

Argument Description Required
array The array to filter Required
criteria The boolean criteria to filter rows by Required

Examples

Filter scores above 90

=FILTER(A1:A6, CELL > 90)

Result ⇒Array: [[93], [96], [91]]

A
1 89
2 93
3 96
4 85
5 91
6 88

Filter names starting with A

=FILTER(A1:A4, LEFT(COL[1], 1) = "A")

Result ⇒Array: [["Alice"], ["Andrew"]]

A
1 Alice
2 Bob
3 Andrew
4 Carol

Filter rows with emails ending in luxo.com

=FILTER(A1:A6, ENDSWITH(COL[1], "luxo.com"))

Result ⇒Array: [["alice@luxo.com", "new lead"], ["bob@luxo.com", "warm lead"], ["frank@luxo.com", "new lead"]]

A B
1 alice@luxo.com new lead
2 bob@luxo.com warm lead
3 carol@outlook.com new lead
4 dave@gmail.com new lead
5 eve@luxo.com cold lead
6 frank@luxo.com new lead

Related Functions

Other Data functions:

  • CHOOSE - Uses index to return a value from the list of value arguments
  • COLUMN - Returns the column number of the current cell context.
  • DROP - Drops the first N rows and optionally first N columns from an array. Returns an error if the result would be empty.
  • GROUPBY - Groups data by a key and applies an aggregator function to each group
  • HLOOKUP - Returns the corresponding value from the specified row of table which matches exactly or approximately to the first row of the table.
  • HSTACK - Horizontally stacks arrays by appending columns
  • INDEX - Returns a cell value from a list or table based on its column and row numbers.
  • LAST - Returns the last N rows and optionally last N columns from an array. Returns an error if the result would be empty.
  • MAP - Processes each row in an array with a formula including a COL or CELL keyword and returns it as a 2D array.
  • MATCH - Returns the position of the item/lookup_value in the lookup_array or range.
  • PICK - Selects specific columns from an array using column numbers or header names
  • ROW - Returns the 1-indexed row number of the current cell
  • SEQUENCE - Returns the list of generated sequential numbers in an array.
  • SORT - Sorts the values in a range or array.
  • SORTBY - Sorts a range or array based on values in one or more corresponding ranges or arrays.
  • TAKE - Returns the first N rows and optionally first N columns from an array. Returns an error if the result would be empty.
  • TRANSPOSE - Returns the result after transposing the rows and columns of an array or range.
  • UNIQUE - Returns a list of unique values in a list or range.
  • VLOOKUP - Returns a value from a table by looking up a value in the first column and returning a value from the specified column
  • VSTACK - Vertically stacks arrays by appending rows
  • XLOOKUP - Searches a range or array for a match and returns the corresponding item from a second range or array. Supports exact and approximate matching, wildcards, and reverse search.