Open In App

How to Organize Google Form Responses with Query Functions

Unlock the power of Google Form responses with Query functions, and say goodbye to data chaos. In this guide, we’ll show you how to effortlessly organize your information, making it more accessible and valuable. Whether you’re handling surveys, feedback, or any type of data collection, you’ll discover the magic of extracting precise insights and creating dynamic reports. No more sifting through a sea of responses – we’ll walk you through the process step by step, so you can become a data organization pro. Join us on this journey, and transform your Google Form responses into an organized and valuable resource.



What is the Query Function

The QUERY function available, in Google Sheets is a tool for analyzing data. It allows users to extract information from tables using SQL syntax. This feature comes in handy when you need to filter, sort, and aggregate data especially when dealing with datasets. It also enables users to generate custom reports within Google Sheets.

How to Create a Google Sheet from your Google Form Responses

Step 1: Create a Google Form

Begin by creating a Google Form that collects the information you want to store in your Google Sheet. You can customize the form fields and questions as needed.



Create your Google form

Step 2: Share your Form

Begin by creating a Google Form that collects the information you want to store in your Google Sheet. You can customize the form fields and questions as needed.

Step 3: Collect Responses

After collecting some responses, open the Google Form and click on the “Responses” tab at the top.

Collect Responses

Step 4: Create a Google Sheet from Responses

Click on the Green Sheets icon next to the ‘Responses’ tab to create a new Google Sheet connected to your form.

Step 5: Select Response Destination

A prompt will pop up giving you the option to either make a spreadsheet or pick from an existing one. Opt for creating a spreadsheet.

Step 6: Link Form to Sheet

A new Google Sheet will be created. It will automatically link to your Google Form, and any new responses will be added to this sheet.

link form to sheet

You can review and edit your responses in the Google Sheet. Any new responses from the form will be automatically added to the sheet as rows.

How to Use QUERY Function in Google Sheets to Collect Your Google Form Responses

The QUERY function in Google Sheets is a useful tool that helps you retrieve, filter, and organize information from a specific range within your spreadsheet data.

Step 1: Understand the Baisc structure of the Query Function

The basic structure or syntax of the QUERY function is:

=QUERY(data, query, headers)

Here,

Data: It is the range of data where you want to work, so it selects the set of cells.

Query: It describes the result you want from your data, so you write the QUERY more as instructions to the function.

Headers: You can specify if your data has column headers (like titles at the top of each column) using this optional parameter. Add numerical ‘1’ if the table contains a header if not then put ‘0’.

Now, let’s understand using an example, where we are trying to sort data by name:

=QUERY(B2:I9, “SELECT B”, 0)

This function will work in the cells data between B to I Columns and 2 to 9 Rows; B2:I9. The QUERY function will retrieve only column ‘B’ from the chosen data and show it in the cell where you’ve entered the QUERY function.

Make sure, you do not use any extra spaces in the function and add the query in “-”, otherwise ERROR can occur.

Step 2: Make a Named Range

As the name suggests, you can simply name the range of data that you want to select every time you use the QUERY function. It is like, labeling a set of data, so that, you can just add the name instead of putting the cell names every time.

To do this, first select the data click on ‘Data’ from the menu, and then select ‘Named Range’ from the options that appear.

Make a named range

On the right side, a panel will open up asking you to name the range. Just enter the name you want to give to the selected range of data.

Here, we are naming the range of data we selected as ‘ Viewers’ this will help us later.

Step 3: SELECT Keyword

To do so, write ‘SELECT’ in the Query field. Now, you can select all the columns in the range by using the asterisk ‘*’ instead of using the cell name.

Or if you want to select specific columns, then you can simply enter the column names in Capital using a comma after each column.

So, if we use specific columns and enter the Query function it will retrieve data of this column and return them in a new table.

Select keyword

Step 4: WHERE Keyword

The WHERE keyword is used to filter the data, which means the function will return data that meets the criteria you have set using the WHERE keyword. This keyword is followed by the SELECT keyword.

For Example, we want to see ‘viewers of OTT’ who were highly satisfied with their choice of OTT platform and rated ‘5’.

We will write QUERY as:

=QUERY(Viewers, “SELECT * WHERE H = 5” , 0

This query will pull all the data from columns B, C, and I from our ‘Viewers’ range and return the rows where the viewers were satisfied with their current OTT platform, and column (H) will be greater than equal to 5.

Step 5: ORDER BY Keyword

You can use the ‘ORDER BY’ keyword in the QUERY function to sort the data in a specific column in either descending order (DESC) or ascending order (ASC), if you do not enter any of these it will take ‘Ascending’ by default.

For example, to sort the range named ‘Viewers’ by the ‘H’ column in descending order, you will write the query as:

=QUERY(Viewers, “SELECT H ORDER BY H DESC”, 0)

Step 6: LIMIT Keyword

LIMIT Keyword is used to Limit the number of rows the Query function will return. This Keyword comes after the ORDER BY keyword.

For example, we want the first 3 viewers from our table, then, we will write the query as:

=QUERY(Viewers, “SELECT * LIMIT 3”, 0)

Limit Keyword

How to Use Query Function in Google Sheets with Multiple Criteria

In Google Sheets, data can be filtered based on various criteria using the QUERY function. The WHERE keyword in the QUERY function allows data filtering using multiple criteria. There are three logical operators, namely AND, OR, and NOT, which can be used to combine these criteria.

For example, if there is a sheet containing employee names in one column A, the total sales in another column B, and the corresponding month of those sales in a third column C, the QUERY function can be applied to extract specific data from this sheet.
 

Sample data

To accomplish this, rules like “Filtering employees with sales exceeding $100 in January” or “Retrieving a list of employees with sales in either February OR March” can be established. The QUERY function enables the retrieval of this information by applying these rules.

Therefore, Google Sheets’ QUERY function permits data filtering in various ways by employing multiple criteria.

1) Logical Operator AND

The Logical Operator AND needs two conditions to be true for a row to show in the result. For instance, if somebody wants a list of workers who both sold a certain amount and are a particular worker, like John, the QUERY function would appear as follows:

=QUERY(A:C, “SELECT * WHERE A=’Charlie’ AND B<1000”)

To include a row using this operator, both the conditions in the `WHERE` clause must be fulfilled.

Take a look at the result, you won’t find Charlie’s April sales. Although the first condition was valid and fulfilled the second condition (sales do not exceed 1000) wasn’t fulfilled. Consequently, since both conditions weren’t satisfied, April sales weren’t included in the result.

Logical Operator AND

If the criteria only require one condition to be met, then logical operator OR should be considered.

2) Logical Operator OR

The OR operator requires any one of two conditions to be true. For example, if somebody wants a list that includes employees with the name Charlie or Nishi, then the formula given below will be used.
 

=QUERY(A:C, “SELECT * WHERE A=’Charlie’ OR A=’Nishi'”)

Using this QUERY will give the result as shown below:

Result of logical operator OR

To include a row using this operator only one condition needs to be fulfilled on either side of the condition in the WHERE clause.

If all criteria require excluding certain rows based on a condition, then the next logical operator should be used.

3) Logical Operator NOT

The logical operator NOT excludes rows that meet a specific condition. For example, in the given sales data list that we used above, one can use the NOT operator to find staff who didn’t sell over 1,000 in May. This will help in identifying underperforming staff.

The NOT operator can be used in a QUERY as:

=QUERY(A:C, “SELECT * WHERE NOT B > 1000 AND C=’May'”)

This QUERY will give a list of employee names who did not make sales more than 1000 in the month of May. The result of this QUERY is shown below.
 

Result of Logical Operator NOT

How to Use Parentheses to Combine Multiple Criteria

Parentheses in logical operators are used to control the order of evaluating conditions, ensuring that specific conditions are assessed first, which can impact the final outcome of a logical expression.

Consider the same list of sales data used in the Logical Operator section. Using parentheses can lead to different outcomes if the conditions after “NOT” are enclosed like this:

=QUERY(A:C, “SELECT * WHERE NOT (B < 1000 AND C=’May’)”)

The result differs from not using parentheses. In this case, one row is missing from May: Nishi’s sales of 680 in May. This happens because logical operators grouped both conditions with parentheses.

When parentheses are used in a WHERE clause, the QUERY function first checks the innermost parentheses. In our example, the innermost condition (B < 1000 AND C=’May’) matches May sales row. However, when “NOT” is added outside, it means the opposite. Consequently, all other rows are selected, and Nishi’s sales are excluded.

How to Use Cell Reference in Google Sheet Query

In Google Sheets Query, using cell references for specifying conditions is possible. Conditions can be directly input into the Query formula or placed in a cell for reference. This method allows for dynamic queries. However, it’s essential to remember that the Query’s SELECT, PIVOT, and GROUP BY clauses don’t use cell references but rather column identifiers like A, B, or Col1, Col2, etc. This distinction is important to avoid confusion when using cell references in the WHERE clause of the Query.

Simple Comparison Operators in Sheets Query with Cell References

Sample Spreadsheet

=Query(A2:B, “Select * where A <= date ‘”&TEXT(D1, “yyyy-mm-dd”)&”‘”)

Result

This approach to data filtering with date literals and cell references in Google Sheets Query greatly improves data analysis efficiency, making adjustments and decision-making more flexible and responsive.

Benefits of Using Query Function in Google Sheets

Using the QUERY function in Google Sheets has several advantages:

  1. With the help of QUERY, you can easily retrieve data from datasets.
  2. Users have the flexibility to customize their data by applying filters sorting it and manipulating it according to their requirements.
  3. This function saves time by simplifying data analysis and reducing effort.
  4. It makes data aggregation effortless enabling users to create summaries and reports with ease.
  5. The QUERY function is particularly useful for generating personalized reports and visualizations, within Google Sheets.

Conclusion

In summary, the QUERY function available, in Google Sheets is a tool that allows users to analyze data effectively. With its SQL syntax individuals can effortlessly extract information from tables. The advantages of utilizing this function are numerous including simplified data extraction, customization through filtering and sorting options, time efficiency, comprehensive data summarization, and streamlined reporting capabilities. To make the most of the QUERY function it is recommended to begin by creating a Google Form to collect responses. Afterwards exporting the responses to Google Sheets will enable users to organize and analyze their data using the QUERY function. Familiarizing oneself with keywords such, as SELECT, WHERE, ORDER BY and LIMIT will ensure the tailoring of data retrieval and analysis. Embracing this approach will enhance efficiency. Provide insights when managing and interpreting data.

FAQs

What is the purpose of the QUERY function in Google Sheets?

The QUERY function in Google­ Sheets is a powerful data analysis tool that allows use­rs to retrieve, filte­r, and manipulate data from their spreadshe­ets. With its SQL-like syntax, it enable­s you to extract specific information, sort and filter data, and pe­rform aggregate functions. This makes it invaluable­ for generating reports and managing large­ datasets efficiently.

Can I use the QUERY function to sort data in ascending and descending order?

Yes, with the­ QUERY function, you can easily sort your data using the “ORDER BY” keyword. This allows you to arrange­ your information based on a specific column, whethe­r in ascending (ASC) or descending (DESC) orde­r. By specifying the sorting order, you have­ full control over how your data is organized to mee­t your needs.

Does the QUERY function work with data that has headers?

Yes, the QUERY function is made for data that has names at the top of columns. If your data has names by using the choice called ‘headers’ then set it to ‘1’ or ‘TRUE,’ this will mean that your data has names. If you set that to ‘0’ or ‘FALSE,’ this will mean there are no names, and the function will think of the first row as data.

How do I organize Google Form responses in Google Sheets?

Step 1: Open Google Sheets on the computer or device.

Step 2: Click on ‘Blank’ option to open a new sheet.

Step 3: Import Google form Responses by clicking on ‘File’ menu → ‘Import’ → ‘Upload’ , then select the Google form Responses file from your device and click ‘Open’.

Step 4: Use the sorting and filtering options in Google Sheets to organize and analyze your responses further.

Is there a way to sort Google Form responses?

Step 1: Open the Google Form to sort the responses for.

Step 2: Click on the ‘Responses’ tab at the top.

Step 3: Click on the green Sheets icon to open the responses in Google Sheets.

Step 4: Use the sorting features to organize the responses in Google Sheets. You can sort by date, alphabetically, or in other ways depending on need.

Step 5: To sort, select the column you want to sort by, then click on the ‘Data’ menu at the top and choose ‘Sort sheet by column A-Z’ or ‘Sort sheet by column Z-A’ to sort in ascending or descending order, respectively.

How do I sort query results in Google Sheets?

Step 1: Open your Google Sheet.

Step 2: Click on the column header where you want to sort the data. This selects the entire column.

Step 3: Click on ‘Data’ menu at the top.

Step 4: Choose the ‘Sort sheet by [column name]’ option. This will arrange your data in ascending order based on the selected column.

Step 5: To sort in descending order, repeat the process of Step 4 and select ‘Sort sheet Z→A [column name]’.

Step 6: Query results will be sorted based on chosen column.


Article Tags :