What is the FILTER function used for in Google Sheets?
The FILTER function in Google Sheets is a powerful tool for filtering data based on specific conditions. This function will take your dataset and only return (display for you) the rows of data that meet the criteria you specify (e.g., only rows corresponding to Customer A).This helps users display only the rows of data that satisfy specific criteria, making data analysis and understanding easier.- Range of values: Data to be filtered on the Google Sheet.
- Condition 1: Condition 1 is the column or row containing true or false values corresponding to the first column or row of the data to be filtered.
- Condition 2…: Condition 2 is additional conditions with the data to be filtered.
- Filtering a range of data based on criteria you specify.
- Used to return multiple criteria.
- Used to return multiple criteria and sort.
| Tên | Sản phẩm |
| Hoa | Viết |
| Lan | Thước |
| Cúc | Tập |
| Cúc | Sách |
| Lan | Bút Chì |
| Hoa | Màu Nước |
| Lan | Máy Tính |
How to Use the FILTER Function in Google Sheets
Are you struggling with managing and analyzing data in Google Sheets? Do you want to find a tool to quickly and effectively filter data? The FILTER function is the perfect solution for you! Here's the simplest way to use the FILTER function in Google Sheets:Using the FILTER function to input multiple conditions
The FILTER function in Google Sheets is used to conditionally filter data in Excel with the following syntax:=FILTER(A1:E16,B1:B16='MALE”Nesting multiple FILTER functions
Function structure: =FILTER(FILTER(range;condition);condition)By using the output of your first FILTER function as the [range of values] of the second FILTER function.Example: We use the data from the example above, using the first FILTER function to filter data greater than 100 and the second FILTER function to filter values greater than 400.Step 1: Select any cell in the data table > Enter the formula =FILTER(FILTER(A1:A10;A1:A10>100);A1:A6>400)Referencing multiple columns in the FILTER function
The FILTER function in Google Sheets allows you to filter data based on conditions and return values that meet those conditions. In case you want to reference multiple columns for the FILTER function, you can use the following syntax:=FILTER(A1:B20,A1:A20 > 50,B1:B20 > 50)Referencing cells in the condition of the FILTER function
Instead of hardcoding a value in [condition 1], you can simply reference another cell containing the condition to be checked. This way, you can easily change the condition to be checked or use other parts of the spreadsheet analytics to make the FILTER function complete.Filtering products with values greater than cell E1. Hence we have the condition A1:A20>E1. =FILTER(A1:A10;A1:A10>E1) as shown in the figureCombining the SORT and FILTER functions
The SORT function is used to sort the rows of a given range of cells based on values that can be from one or more columns. The SORT function helps users arrange data in ascending or descending order.To combine the SORT function in FILTER, we have the formula=SORT(FILTER(range; condition1; [condition2; ...]); sort_column; ascending_order; [sort_column2; ...]; [ascending_order2; ...])- FILTER(range; condition1; [condition2; ...]): The filtered data range to sort.
- sort_column: The index of the data column or a column outside the range containing the values you want to sort.
- ascending_order: TRUE to sort sort_column in ascending order. FALSE to sort sort_column in descending order.
- [sort_column2; ...]; [ascending_order2; ...]: Similar to sort_column and ascending_order arguments.
- FILTER(A2:A15;C2:C15=F1): Filter products by supplier.
- 1: Data column to sort is the product column.
- FALSE: Sort in descending order.
Some data types supported by the FILTER function for filtering
The FILTER function is an incredibly powerful tool in Google Sheets that helps you filter data based on various criteria. This function can be used to filter data of different data types, including:Combining with the COUNT function
Consider the following dataset to execute the task of combining with the COUNT function, along with the SUM function, the SORT function, and combining multiple conditions.| Date | Value | Product |
| 27/05/2021 | 333 | Dog |
| 28/05/2021 | 100 | Cat |
| 29/05/2021 | 400 | Dog |
| 30/05/2021 | 500 | Tiger |
| 06/06/2021 | 700 | Cat |
| 01/06/2021 | 100 | Dog |
