How can I use multiple criteria in a Google Sheets query? 2

How can I use multiple criteria in a Google Sheets query?

The use of multiple criteria in a Google Sheets query allows users to filter and organize data based on specific conditions. By combining multiple criteria, users can refine their search and obtain more specific results from their spreadsheet data. This feature is particularly useful in organizing large sets of data and can be easily applied by using the “QUERY” function in Google Sheets. By specifying multiple criteria, users can efficiently analyze and manipulate their data to meet their specific needs.

Google Sheets Query: Use Multiple Criteria in Query


You can use the AND and OR operators to perform a Google Sheets query with multiple criteria.

Example of AND Operator:

=QUERY(A2:C10,"select A, B, C where A contains 'Hello' and C > 10")

Example of OR Operator:

=QUERY(A2:C10,"select A, B, C where A contains 'Hey' or C = 10")

The following examples show how to use each operator in practice.

Example 1: Google Sheets Query Using AND Operator

Suppose we have the following dataset in Google Sheets that contains information about various basketball teams:

We can use the following query to retrieve the teams that are in the East conference and scored more than 90 points:

=QUERY(A2:D11,"select A, B, C, D where B contains 'East' and C > 90")

The following screenshot shows how to use this query in practice:

Notice that the Magic and the Heat are selected because they’re the only two teams that meet both criteria specified in our query.

Example 2: Google Sheets Query Using OR Operator

Once again suppose we have the following dataset in Google Sheets:

=QUERY(A2:D11,"select A, B, C, D where B contains 'East' or C > 90")

The following screenshot shows how to use this query in practice:

Every team that is selected met at least one of the criteria specified in our query.

That is, each team selected was either in the ‘East’ conference or they scored more than 90 points.

The following tutorials explain how to perform other common tasks with Google Sheet queries:

Cite this article

stats writer (2024). How can I use multiple criteria in a Google Sheets query?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-multiple-criteria-in-a-google-sheets-query/

stats writer. "How can I use multiple criteria in a Google Sheets query?." PSYCHOLOGICAL SCALES, 12 May. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-multiple-criteria-in-a-google-sheets-query/.

stats writer. "How can I use multiple criteria in a Google Sheets query?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-multiple-criteria-in-a-google-sheets-query/.

stats writer (2024) 'How can I use multiple criteria in a Google Sheets query?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-multiple-criteria-in-a-google-sheets-query/.

[1] stats writer, "How can I use multiple criteria in a Google Sheets query?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, May, 2024.

stats writer. How can I use multiple criteria in a Google Sheets query?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top