How to Filter Next Row to the Filter Criteria Row in Google Sheets

Are you struggling to filter data in Google Sheets when your filter criteria are in one row, but you need the results from the adjoining row? Well, fret not! In this article, I’ll show you a simple and effective method to solve this problem.

Organizing Your Data

Before we dive into the solution, let’s quickly address the importance of organizing your data properly. While Google Sheets offers a range of powerful functions and features for well-arranged datasets, there are instances where you may want to present or keep your data in a specific manner.

In such cases, manipulating your data can become challenging, especially when you need to filter based on criteria that are in one row but require data from the next row.

The Filter Next Row Solution

To extract the values in the rows below the filter criteria row, you can follow these steps:

Step 1: Filter Row Numbers Matching the Condition

First, filter the rows that match the filter criteria using the ROW and FILTER functions in Google Sheets. For example, if your condition is “Supply,” you can use the following formula:

=filter(row(C:C), C:C="Supply")

This formula will return the row numbers that contain the filter criteria.

Step 2: Filter Row Numbers Below the Matching Criteria Rows

To get the row numbers for the next rows matching the criteria, add 1 to the filtered result. Modify the previous formula as follows:

=ArrayFormula(filter(row(C:C), C:C="Supply")+1)

This formula will give you the row numbers of the rows below the filter criteria rows.

Step 3: Filter Values Using Regexmatch

Now that you have the row numbers, you can use the REGEXMATCH function to filter the values. Create a regular expression using the row numbers from Step 2 and apply it as the criteria in the FILTER function.

=filter(C:C, regexmatch(row(C:C)&"", "^"&textjoin("$|^",true,filter(row(C:C),C:C="Supply")+1)&"$"))

This final formula will filter the values from the rows below the filter criteria rows.

Additional Tips

If you need to filter based on multiple criteria, you can modify the formula to include them. For example, if you want to filter rows next to the “Supply” and “testing & commissioning” criteria, use the following formula:

=filter(C:C, regexmatch(row(C:C)&"", "^"&textjoin("$|^",true,filter(row(C:C),regexmatch(C:C,"Supply|testing & commissioning"))+1)&"$"))

Remember that this formula is case-sensitive. If you want to make it case-insensitive, simply add “(?i)” before each criterion in the REGEXMATCH function:

=filter(C:C, regexmatch(row(C:C)&"", "^"&textjoin("$|^",true,filter(row(C:C),regexmatch(C:C,"(?i)Supply|testing & commissioning"))+1)&"$"))

And there you have it! By following these steps, you can easily filter the next row to the filter criteria row in Google Sheets.

For more Google Sheets tips and tricks, visit Crawlan.com, your go-to resource for all things Google Sheets. Happy filtering!

Related posts