0
0
Google Sheetsspreadsheet~20 mins

WHERE clause for filtering in Google Sheets - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
WHERE Clause Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
Filtering rows with WHERE clause in Google Sheets QUERY
Given a sheet named 'Sales' with columns Date, Product, and Amount, which QUERY formula filters rows where Amount is greater than 100?
Google Sheets
QUERY(Sales!A:C, "SELECT A, B, C WHERE C > 100", 1)
AQUERY(Sales!A:C, "SELECT A, B, C WHERE Amount > 100", 1)
BQUERY(Sales!A:C, "SELECT A, B, C WHERE C > 100", 1)
CQUERY(Sales!A:C, "SELECT A, B, C WHERE C >= 100", 1)
DQUERY(Sales!A:C, "SELECT A, B, C WHERE B > 100", 1)
Attempts:
2 left
💡 Hint
Remember that column letters in QUERY use letters like A, B, C, not column names.
🔧 Formula Fix
intermediate
2:00remaining
Identify the syntax error in this QUERY with WHERE clause
Which QUERY formula has a syntax error when filtering rows where Product equals 'Apple'?
AQUERY(Sales!A:C, "SELECT A, B, C WHERE B == 'Apple'", 1)
B)1 ,"'elppA' = B EREHW C ,B ,A TCELES" ,C:A!selaS(YREUQ
CQUERY(Sales!A:C, "SELECT A, B, C WHERE B = 'Apple'", 1)
DQUERY(Sales!A:C, "SELECT A, B, C WHERE B = \"Apple\"", 1)
Attempts:
2 left
💡 Hint
Check the operator used for equality in QUERY language.
optimization
advanced
2:00remaining
Optimizing QUERY with multiple WHERE conditions
Which QUERY formula efficiently filters rows where Amount is greater than 50 and Product is 'Banana'?
AQUERY(Sales!A:C, "SELECT A, B, C WHERE C > 50 OR B = 'Banana'", 1)
BQUERY(Sales!A:C, "SELECT A, B, C WHERE C > 50 AND B = Banana", 1)
CQUERY(Sales!A:C, "SELECT A, B, C WHERE C > 50 AND B = 'Banana'", 1)
DQUERY(Sales!A:C, "SELECT A, B, C WHERE C > 50 AND B == 'Banana'", 1)
Attempts:
2 left
💡 Hint
Use AND to combine conditions and single '=' for equality.
🔧 Formula Fix
advanced
2:00remaining
Why does this QUERY return no rows?
Given the formula QUERY(Sales!A:C, "SELECT A, B, C WHERE C > 100 AND B = 'Orange'", 1), why might it return no rows even if data exists?
ABecause the QUERY function requires numeric columns to be referenced by name, not letter.
BBecause the WHERE clause uses AND instead of OR, which is invalid syntax.
CBecause column C is text, so '> 100' causes an error and returns no rows.
DBecause the data has no rows where Amount is greater than 100 and Product is exactly 'Orange'.
Attempts:
2 left
💡 Hint
Check if the data actually matches both conditions at the same time.
🧠 Conceptual
expert
2:00remaining
Understanding WHERE clause behavior with NULL or empty cells
In Google Sheets QUERY, what happens when you filter with WHERE C > 0 but some rows in column C are empty or contain text?
ARows with empty or text values in column C are excluded because they do not satisfy the numeric condition.
BQUERY throws an error because of mixed data types in column C.
CRows with empty cells are included, but rows with text are excluded.
DRows with empty or text values are treated as zero and included if zero > 0 is true.
Attempts:
2 left
💡 Hint
Think about how QUERY treats non-numeric values in numeric comparisons.