How can I query from multiple sheets in Google Sheets? 2

How can I query from multiple sheets in Google Sheets?

Google Sheets allows users to query information from multiple sheets by using the “QUERY” function. This function enables users to extract specific data from multiple sheets within a single workbook, eliminating the need to manually search through each sheet. The query language in Google Sheets is similar to SQL, making it easy for users to filter, sort, and manipulate data from different sheets. By using this feature, users can efficiently analyze and consolidate data from various sources in one place, saving time and increasing productivity. Additionally, users can also use the “IMPORTRANGE” function to import data from other Google Sheets documents, further expanding the possibilities for data querying and analysis.

Google Sheets: Query From Multiple Sheets


You can use the following basic syntax to query from multiple sheets in Google Sheets:

=QUERY({Sheet1!A1:C9;Sheet2!A1:C9;Sheet3!A1:C9})

You can also use the following syntax to select specific columns from the sheets:

=QUERY({Sheet1!A1:C9;Sheet2!A1:C9;Sheet3!A1:C9}, "select Col1, Col2") 

The following examples show how to use this syntax in practice.

Example 1: Query From Multiple Sheets

Suppose we have the following two sheets called Week1 and Week2 that contain data about basketball players for two different weeks:

We can use the following formula to query data from both sheets and place the results in a new sheet called All_Data:

=QUERY({Week1!A1:C9;Week2!A1:C9})

Here’s how to use the formula in practice:

Notice that all of the data from Week2 is simply stacked underneath the data from Week1.

Example 2: Query & Select Columns From Multiple Sheets

We can use the following formula to query data from both sheets and place the results in a new sheet called All_Data and also select only specific columns to appear in the new sheet:

=QUERY({Week1!A1:C9;Week2!A1:C9}, "select Col1, Col2")

Notice that only the first two columns (“Team” and “Points”) are shown in the final sheet since we specifically chose Col1 and Col2 in our select statement.

The following tutorials explain how to perform other common queries in Google Sheets:

Cite this article

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

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

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

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

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

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

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