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.
=SUMIF($A$2:$A$6,A2,$B$2:$B$6)=QUERY(A2:B6,"SELECT A,SUM(B) GROUP BY A",1)Computed by a real spreadsheet engine on the sample data below.
| Region | Sales |
| North | 120 |
| South | 80 |
| North | 200 |
| South | 150 |
| East | 90 |
=SUMIF($A$2:$A$6,A2,$B$2:$B$6)→320
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.
Yes. Replace SUM(B) with COUNT(B) in the QUERY string: SELECT A,COUNT(B) GROUP BY A.
Add the second column to both SELECT and GROUP BY: SELECT A,B,SUM(C) GROUP BY A,B.
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 QUERY GROUP BY with multiple columns in Google Sheets to create multi-level summaries. Excel alternative uses SUMIFS with multiple criteria ranges.
How-toFilter QUERY results in Google Sheets using WHERE with AND and OR conditions. Excel users can replicate this with FILTER using * for AND and + for OR.
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: