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:A2,A2,B$2:B2)=ARRAYFORMULA(MMULT((ROW(B2:B7)>=TRANSPOSE(ROW(B2:B7)))*1,B2:B7))Computed by a real spreadsheet engine on the sample data below.
| Date | Amount |
| 2024-01-01 | 500 |
| 2024-01-02 | 300 |
| 2024-01-03 | 750 |
| 2024-01-04 | 200 |
| 2024-01-05 | 620 |
=SUMIF(A$2:A2,A2,B$2:B2)→500
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.
No. The Google Visualization API Query Language does not support window functions. You need a helper formula (SUMIF or MMULT) alongside the QUERY output to produce a running total.
Add a helper column with the year-month (TEXT(A2,"YYYY-MM")), then use SUMIFS with both the date column and the year-month column as criteria, locking only the top anchor: =SUMIFS(C$2:C2,D$2:D2,D2) where D holds the month key.
Yes — the MMULT approach with ARRAYFORMULA spills all running total values from a single cell. It is computation-heavy for large ranges but works well for ≤ 200 rows.
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-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-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: