Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
Heads up: Excel and Google Sheets do this differently.
=FILTER(A2:C10,(B2:B10="Electronics")+(B2:B10="Clothing"))=QUERY(A1:C10,"SELECT A, B, C WHERE (B = 'Electronics' OR B = 'Clothing') AND C > 500",1)Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
Need it for your exact data?
Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.
QUERY supports NOT with conditions: WHERE NOT B = 'Electronics'. For a list exclusion, chain them: WHERE B != 'Electronics' AND B != 'Clothing'. There is no native IN(...) operator in the Google Visualization API query language.
Case sensitivity is the most common cause. QUERY string matching is case-sensitive by default. Ensure 'Electronics' matches the exact capitalisation in your data, or use LOWER() in the formula and LOWER(B) = 'electronics' in the query string.
Yes. WHERE always comes before GROUP BY in the query string: SELECT B, SUM(C) WHERE C > 500 GROUP BY B. QUERY respects the same clause order as SQL.
Use Google Sheets QUERY with a WHERE clause to filter rows dynamically — Excel users can use FILTER as the equivalent.
Error fixQUERY parse error in Google Sheets means the SQL-like query string has a syntax mistake. Find the exact error and fix it here.
How-toUse Google Sheets QUERY with GROUP BY and SUM to aggregate data by category — use SUMIF for the Excel equivalent.
How-toUse QUERY GROUP BY with multiple columns in Google Sheets to create multi-level summaries. Excel alternative uses SUMIFS with multiple criteria ranges.
How-toBuild a running total in Google Sheets by combining QUERY for ordering with ARRAYFORMULA and SUMIF. Excel alternative uses a simple SUMIF with a locked anchor row.
How-toCombine QUERY and IMPORTRANGE in Google Sheets to filter and aggregate data from another spreadsheet file. There is no Excel equivalent — use Power Query to connect workbooks instead.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: