Home / Sheets questions cookbook / Expenses by category by month
Google Sheets · Question cookbook

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.

By · Published November 8, 2026

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

ABCD
1DateVendorCategoryAmount
22026-01-01Warehouse leaseRent4800
32026-01-02Accounting softwareSoftware90
42026-01-02Online store platformSoftware299
52026-01-03Inventory appSoftware129
62026-01-03Office suiteSoftware96
…202 more rows
Expenses

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.

Example on sample data
fx=SUMIFS(Expenses!$D:$D, Expenses!$C:$C, $A2, Expenses!$A:$A, ">="&B$1, Expenses!$A:$A, "<"&EDATE(B$1,1))
ABCDE
1CategoryAug 2026Sep 2026Oct 2026Total
2Payroll$22,010$21,974$21,957$65,941
3Shipping & freight$10,607$8,930$10,783$30,320
4Rent$4,800$4,800$4,800$14,400
5Marketing$3,059$5,867$3,038$11,964
6Utilities$1,052$914$815$2,781
7Travel$0$1,440$784$2,224
8Software$699$699$699$2,097
9Office & supplies$139$501$201$841
10Total$42,366$45,125$43,077$130,568
SummaryExpenses

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

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:

Example on sample data
fx=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")
ABCDE
1CategoryAug 2026Sep 2026Oct 2026Total
2Payroll$22,010$21,974$21,957$65,941
3Shipping & freight$10,607$8,930$10,783$30,320
4Rent$4,800$4,800$4,800$14,400
5Marketing$3,059$5,867$3,038$11,964
6Utilities$1,052$914$815$2,781
7Travel$0$1,440$784$2,224
8Software$699$699$699$2,097
9Office & supplies$139$501$201$841
10Total$42,366$45,125$43,077$130,568
Sheet1

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.

Frequently asked questions

How do I sum expenses by category and month in Google Sheets?
Put categories down column A and month start dates across row 1, then use =SUMIFS(amount, category, $A2, date, ">="&B$1, date, "<"&EDATE(B$1,1)) and copy it across the grid. A pivot table with Category in Rows and Date grouped by Year-Month in Columns gives the same totals.
How do I group dates by month in a Google Sheets pivot table?
Right-click a date in the pivot table's rows or columns and choose Create pivot date group, then Month or Year-Month. Year-Month keeps January 2025 and January 2026 apart.
Why are some of my expenses missing from the total?
Most often the category is spelled differently from the one in column A, or the date is stored as text. Check both with a filter on the Expenses tab.