How to Use Cell Reference in a Formula (Google Sheets Query)

By Jake Sheridan

In this article, we will explore how to effectively use cell references in a formula on Google Sheets. If you’re looking to level up your Google Sheets skills, you’re in the right place!

Understanding Google Sheets Query

Before we dive into an example, let’s first understand how a Google Sheets query works. The syntax for a Google Sheets query is as follows:

=QUERY(data, query, [headers])

The Google Sheets query function requires three arguments:

  1. The range of data you want to query.
  2. The query you want to execute, enclosed in quotation marks.
  3. An optional number indicating the number of header rows in your data.

Using Cell Reference in a Formula with Google Sheets Query

Let’s walk through an example to showcase how to use cell references in a formula with Google Sheets Query.

Step 1: Define Your Goal

For instance, let’s say you want to extract the names of players who scored 45 points.

Step 2: Set Up the Formula

To begin the query formula, select an empty cell where you want to enter the formula. In this example, let’s use cell D2. Then, input an equal sign followed by “QUERY” and an opening parenthesis. A blue question mark will appear on the side – you can click on it to view the necessary arguments for the function.

Step 3: Insert Your Arguments

Next, insert your arguments. For the data range, select A2:B8 as our first argument. Then, add “Select A where B contains ‘ ” & E1 & ” ‘ ” as our second argument. Remember to always close all formulas with a closing parenthesis to indicate that the formula is complete.

Step 4: See the Results

Once you hit Enter, the players who scored 45 points will appear. It should look something like this.

Query Results

Note!

Please note that the data returned by the query function will not be formatted. You have the flexibility to modify the data according to your preferences.

Summary

That’s all there is to it! Feel free to copy the example spreadsheet here to see how it’s done. The most important lesson is to have fun while exploring the capabilities of Google Sheets.

In this tutorial, we’ve covered how to effectively use cell references in a formula using the Google Sheets query function. If you want to learn more, be sure to check out other Google Sheets tutorials on Crawlan.com. Happy querying!

Related posts