TRUECALC
Functions

FILTER

Filter an array by a boolean mask

Try it

When to use it

When do I use FILTER instead of IF or manually hiding rows?

Use FILTER when you need a dynamic sub-array of rows or columns that match a condition, returning only the matching elements automatically without helper columns or manual row hiding.

Used in

operations

Syntax

FILTER(array, include, [if_empty])

Examples

=FILTER({1,2,3,4,5},{TRUE,FALSE,TRUE,FALSE,TRUE}) // => 1
=FILTER({10,20,30,40},{10,20,30,40}>15) // => 20
=FILTER({1,2,3},{TRUE,TRUE,TRUE}) // => 1

On this page