How to Track Expenses by Category by Month in Google Sheets
Categories down the side, months across the top, totals on both edges. One SUMIFS formula fills the whole grid.
The short answer: categories in column A, month start dates in row 1, and =SUMIFS(Expenses!$D:$D, Expenses!$C:$C, $A2, Expenses!$A:$A, ">="&B$1, Expenses!$A:$A, "<"&EDATE(B$1,1)) in every cell. In the sample data, August to October 2026 operating expenses total $130,568, $65,941 of it payroll.
The sample data
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Date | Vendor | Category | Amount |
| 2 | 2026-01-01 | Warehouse lease | Rent | 4800 |
| 3 | 2026-01-02 | Accounting software | Software | 90 |
| 4 | 2026-01-02 | Online store platform | Software | 299 |
| 5 | 2026-01-03 | Inventory app | Software | 129 |
| 6 | 2026-01-03 | Office suite | Software | 96 |
| … | 202 more rows | |||
Sample data: a tab named Expenses with 207 operating expenses from January to October 2026, one row per bill or payment. Download expenses.csv and import it (File → Import) to follow along. The business is fictional.
The classic way: one SUMIFS across a grid
Column A of Expenses is Date, C is Category and D is Amount. On a new tab, put month start dates across row 1: =DATE(2026,8,1) in B1, =EDATE(B1,1) in C1 and D1, formatted "MMM yyyy". Type the categories down column A. Then in B2:
=SUMIFS(Expenses!$D:$D, Expenses!$C:$C, $A2, Expenses!$A:$A, ">="&B$1, Expenses!$A:$A, "<"&EDATE(B$1,1))
The dollar signs are the trick: $A2 locks the category column and B$1 locks the month row, so one formula copied across and down fills the grid. E is =SUM(B2:D2), the Total row is =SUM(B2:B9), and sorting by column E puts the biggest costs on top.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Category | Aug 2026 | Sep 2026 | Oct 2026 | Total |
| 2 | Payroll | $22,010 | $21,974 | $21,957 | $65,941 |
| 3 | Shipping & freight | $10,607 | $8,930 | $10,783 | $30,320 |
| 4 | Rent | $4,800 | $4,800 | $4,800 | $14,400 |
| 5 | Marketing | $3,059 | $5,867 | $3,038 | $11,964 |
| 6 | Utilities | $1,052 | $914 | $815 | $2,781 |
| 7 | Travel | $0 | $1,440 | $784 | $2,224 |
| 8 | Software | $699 | $699 | $699 | $2,097 |
| 9 | Office & supplies | $139 | $501 | $201 | $841 |
| 10 | Total | $42,366 | $45,125 | $43,077 | $130,568 |
Computed from the sample CSV above. Cells formatted as currency and percent.
Pivot table version: Insert → Pivot table. Category in Rows, Date in Columns, Amount in Values (SUM). Right-click any date heading and choose Create pivot date group → Year-Month, then filter Date to the months you want. Sort the rows by the grand total, descending. To get the category list for the SUMIFS grid, =UNIQUE(Expenses!C2:C) and paste the result as values.
Gotchas
- A month with nothing shows $0, not blank. The sample has no travel in August 2026 ($0 in the grid), which is right. A pivot table shows an empty cell instead.
- Category spelling. "Software" and "Software " are two categories to SUMIFS. Use a dropdown for the category column (Data → Data validation) to stop new spellings.
- Payment date vs period. An annual software bill paid in January lands in January. If you report expenses by the month they cover, spread it first.
The one-cell way: =QUIRIZ
With the Quiriz add-on for Google Sheets, you type the question instead of building the formula. =QUIRIZ does not read the cells around it: it answers from the datasets in your Quiriz account. For this example, upload expenses.csv as a dataset, or connect QuickBooks. You can also add a Google Sheet itself as a dataset that refreshes on a schedule. Then, in any empty cell:
=QUIRIZ("operating expenses by category for August, September and October 2026, one column per month plus a total column, sorted by total, with a total row", "table")
The "table" mode spills the answer down and to the right from that cell, header row first:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Category | Aug 2026 | Sep 2026 | Oct 2026 | Total |
| 2 | Payroll | $22,010 | $21,974 | $21,957 | $65,941 |
| 3 | Shipping & freight | $10,607 | $8,930 | $10,783 | $30,320 |
| 4 | Rent | $4,800 | $4,800 | $4,800 | $14,400 |
| 5 | Marketing | $3,059 | $5,867 | $3,038 | $11,964 |
| 6 | Utilities | $1,052 | $914 | $815 | $2,781 |
| 7 | Travel | $0 | $1,440 | $784 | $2,224 |
| 8 | Software | $699 | $699 | $699 | $2,097 |
| 9 | Office & supplies | $139 | $501 | $201 | $841 |
| 10 | Total | $42,366 | $45,125 | $43,077 | $130,568 |
Same figures as the formula result above, from the same sample data. The spilled cells are plain numbers, so you can format them, total them or chart them; here they are formatted as currency and percent. Column headings are written with each answer and may be worded differently.
The other modes: "verbose" (the default) answers in a sentence, "bullets" writes two to four points one per cell, and "notes" adds how the figure was calculated. Install Quiriz for Google Sheets and try the question on your own data.
Ask the question, get the table
Quiriz answers business questions in a Google Sheets cell, from your imported files, scheduled Google Sheets and connected tools. Free to start.
Install for Google Sheets →Free on the Google Workspace Marketplace. Or try it on sample data first, no signup.