13.1 C
London
Thursday, May 15, 2025
HomeSoftware TutorialsGoogle SheetsGoogle Sheets Query: How to Use the COUNT Function

Google Sheets Query: How to Use the COUNT Function

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

You can use the COUNT() function in a Google Sheets query to count the number of rows that meet certain conditions.

Method 1: Count Total Rows

=QUERY(A1:C13, "select count(A)")

Method 2: Count Total Rows that Meet One Criteria

=QUERY(A1:C13, "select count(A) where B>100")

Method 3: Count Total Rows that Meet Multiple Criteria

=QUERY(A1:C13, "select count(A) where A='Mavs' OR B>100")

=QUERY(A1:C13, "select count(A) where A='Mavs' AND B>100")

The following examples show how to use each of these methods in practice.

Method 1: Count Total Rows

We can use the following formula to count the total number of teams:

We can see that there are 12 total teams.

Example 2: Count Total Rows that Meet One Criteria

We can use the following formula to count the total number of teams where the points is greater than 100:

We can see that there are 2 teams that have over 100 points.

We can use the following formula to count the total number of teams that have less than 100 points:

We can see that 10 teams have less than 100 points.

Example 3: Count Total Rows that Meet Multiple Criteria

We can use the following formula to count the total number of teams where the team name is “Mavs” or where the points is greater than 100:

We can see that 3 teams meet either of these criteria.

We can use the following formula to count the total number of teams where the points is greater than 90 and the rebounds is greater than 30:

We can see that 2 teams meet both of these criteria.

Additional Resources

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

Google Sheets Query: Select Rows that Contain String
Google Sheets Query: How to Use Group By
Google Sheets Query: How to Use Order By

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories