6.1 C
London
Thursday, December 19, 2024
HomeSoftware TutorialsGoogle SheetsGoogle Sheets Query: How to Use the SUM Function

Google Sheets Query: How to Use the SUM 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 SUM() function in a Google Sheets query to find the sum of values in rows that meet certain conditions.

Method 1: Sum All Rows

=QUERY(A1:C13, "select sum(C)")

Method 2: Sum Rows that Meet One Criteria

=QUERY(A1:C13, "select sum(C) where B>100")

Method 3: Sum Rows that Meet Multiple Criteria

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

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

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

Method 1: Sum All Rows

We can use the following formula to sum the total points scored by all teams:

We can see that the teams scored a total of 1,141 points.

Example 2: Sum Rows that Meet One Criteria

We can use the following formula to sum the total points scored by teams who had less than 30 rebounds:

The total points scored by teams who had less than 30 rebounds was 679.

Example 3: Sum Rows that Meet Multiple Criteria

We can use the following formula to sum the total rebounds by teams where the team name is equal to “Mavs” or where the points is greater than 100:

The sum of the rebounds among teams that meet either of these criteria is 84.

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
Google Sheets Query: How to Use the COUNT Function

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