0
0
Google Sheetsspreadsheet~10 mins

GROUP BY with aggregation in Google Sheets - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the formula to sum sales by product.

Google Sheets
=QUERY(A1:C10, "SELECT A, SUM(C) GROUP BY [1]", 1)
Drag options to blanks, or click blank then click option'
AA
BB
CC
DD
Attempts:
3 left
💡 Hint
Common Mistakes
Grouping by the wrong column letter.
Not using the column letter but a number.
2fill in blank
medium

Complete the formula to count orders by customer.

Google Sheets
=QUERY(A1:C20, "SELECT B, COUNT(A) GROUP BY [1]", 1)
Drag options to blanks, or click blank then click option'
AD
BA
CB
DC
Attempts:
3 left
💡 Hint
Common Mistakes
Grouping by order ID instead of customer.
Using column numbers instead of letters.
3fill in blank
hard

Fix the error in the formula to find average price by category.

Google Sheets
=QUERY(A1:D15, "SELECT D, AVG(C) GROUP BY [1]", 1)
Drag options to blanks, or click blank then click option'
AC
BD
CB
DA
Attempts:
3 left
💡 Hint
Common Mistakes
Grouping by the price column instead of category.
Using a column that is not in SELECT.
4fill in blank
hard

Fill both blanks to sum sales and count orders by region.

Google Sheets
=QUERY(A1:E20, "SELECT [1], SUM(E), COUNT(A) GROUP BY [2]", 1)
Drag options to blanks, or click blank then click option'
AB
BC
DD
Attempts:
3 left
💡 Hint
Common Mistakes
Using different columns for SELECT and GROUP BY.
Grouping by a column not in SELECT.
5fill in blank
hard

Fill all three blanks to select category, average price, and max quantity grouped by category.

Google Sheets
=QUERY(A1:E30, "SELECT [1], AVG(C), MAX(D) GROUP BY [2] ORDER BY [3] DESC", 1)
Drag options to blanks, or click blank then click option'
AD
BC
DB
Attempts:
3 left
💡 Hint
Common Mistakes
Using different columns for grouping and ordering.
Ordering by a column not in SELECT.