Filter rentang dengan kriteria tertentu
=FILTER(array, include, [if_empty])
| Parameter | Deskripsi |
|---|---|
array |
Range or array to filter. |
include |
Boolean array, supplied as criteria. |
if_empty |
[optional] Value to return when no results are returned. |
The formula in cell D5 looks like this:
=FILTER(B5:B14,B5:B14>100)
Notice that the include argument is a logical expression, B5:B14. Because there are 10 cells in the range, the expression returns an array that contai
=FILTER(B5:B14,{FALSE;TRUE;TRUE;FALSE;FALSE;TRUE;FALSE;FALSE;TRUE;FALSE})
In the example shown above, the formula in F5 is:
=FILTER(B5:D14,D5:D14=H2,"No results")
Values can be hardcoded as well. The formula below has the same result as above with "red" hardcoded into the criteria:
=FILTER(B5:D14,D5:D14="Red","No results")
FILTER will return a #CALC! error if no matching data is found, but you can use the optional is_empty argument to return a different result. Often, is
=FILTER(array,include,"No results") // display message
To display nothing when no matching data is found, provide an empty string ("") for if_empty:
=FILTER(array,include,"") // display nothing