Most people tracking expenses in a spreadsheet have the same problem: the data goes in but nothing comes out. There's a long list of entries and no easy way to see what the total is by category, or what you spent this month vs last month, without manually filtering and summing.
This tutorial builds an expense tracker that does the work automatically. By the end, you'll have a sheet that:
- Logs every expense with date, amount, category, and description
- Calculates monthly totals per category automatically using formulas
- Optionally emails you a weekly summary of spending
The first two parts are formula-only — no code. The email summary is optional and requires a short Apps Script.
---
What You Need
- A Google account
- A Google Sheet (new or existing)
- About 20 minutes for the full setup
---
Step 1: Set Up the Expense Log
Open a new Google Sheet. On the first tab (rename it Log by right-clicking the tab name), add these headers in Row 1:
| A | B | C | D | |---|---|---|---| | Date | Amount | Category | Description |
Add a few sample rows so you can test formulas as you go:
| Date | Amount | Category | Description | |------|--------|----------|-------------| | 2026-04-01 | 42.50 | Office Supplies | Printer paper | | 2026-04-03 | 120.00 | Software | Canva subscription | | 2026-04-05 | 18.75 | Meals | Team lunch | | 2026-04-08 | 85.00 | Software | Zoom renewal | | 2026-04-10 | 34.20 | Office Supplies | Pens and notebooks |
Date format: Use Format > Number > Date on the Date column. If Sheets treats dates as text, the monthly summary formulas won't work.
Amount format: Use Format > Number > Currency on the Amount column. This formats display only — the underlying values stay as numbers, which is what matters for calculations.
---
Step 2: Add a Category Dropdown
Consistent category names are what make the summary formulas work. A dropdown prevents typos.
- Click the header of column C to select the entire column
- Click Data > Data validation
- Under Criteria, select Dropdown (from a list)
- Type your categories separated by commas:
Office Supplies, Software, Meals, Travel, Marketing, Utilities, Other - Click Save
Now every entry in the Category column uses one of your defined values. Adjust the list to match how you actually categorize spending.
---
Step 3: Build the Monthly Summary
Add a second tab. Right-click the + icon at the bottom and select Insert sheet. Rename it Summary.
In the Summary tab, set up a table like this:
| | A | B | C | D | E | |--|---|---|---|---|---| | 1 | Category | Apr 2026 | May 2026 | Jun 2026 | Total | | 2 | Office Supplies | | | | | | 3 | Software | | | | | | 4 | Meals | | | | | | 5 | Travel | | | | | | 6 | Marketing | | | | | | 7 | Utilities | | | | | | 8 | Other | | | | | | 9 | Monthly Total | | | | |
Fill column A with your categories (matching exactly what you put in the dropdown).
For each month column, add a SUMIFS formula that sums amounts from the Log tab where the category matches and the date falls within that month.
In cell B2, for "Office Supplies" in April 2026:
=SUMIFS(Log!$B:$B, Log!$C:$C, $A2, Log!$A:$A, ">="&DATE(2026,4,1), Log!$A:$A, "<"&DATE(2026,5,1))Plain English: add up all amounts in column B of the Log tab, where column C matches the category in cell A2, and column A (date) is between April 1 and May 1, 2026.
To extend this to other months, change the year and month numbers:
- May 2026:
DATE(2026,5,1)andDATE(2026,6,1) - June 2026:
DATE(2026,6,1)andDATE(2026,7,1)
Copy the formula down column B for each category row. The $A2 reference moves down with each row, picking up the right category name.
For the Monthly Total row (row 9 in the example), add a simple SUM:
=SUM(B2:B8)Copy this across all month columns.
For the Total column (column E), sum across all months:
=SUM(B2:D2)---
Step 4: Add a Running Total for the Current Month (Optional)
On the Log tab, add a small summary box in a spare area — say, column F. In F1, put:
=TEXT(TODAY(),"MMMM YYYY")This displays the current month name and year.
In F2:
=SUMIFS($B:$B, $A:$A, ">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1), $A:$A, "<"&DATE(YEAR(TODAY()),MONTH(TODAY())+1,1))This calculates the current month's total automatically, without you updating any dates. Each month it resets to count only the current month's entries.
---
Step 5: Email a Weekly Summary (Optional)
If you want a summary emailed to you every week, this Apps Script reads the Summary tab and sends the current month's totals.
Open Extensions > Apps Script, delete the placeholder, and paste:
function sendWeeklyExpenseSummary() {
// -- SETTINGS --
var recipientEmail = "you@example.com"; // Change to your email
var summarySheetName = "Summary"; // Tab name of your Summary sheet
var logSheetName = "Log"; // Tab name of your Log sheet
var ss = SpreadsheetApp.getActiveSpreadsheet();
var summarySheet = ss.getSheetByName(summarySheetName);
var logSheet = ss.getSheetByName(logSheetName);
// Find the current month column in the Summary sheet
// Assumes row 1 has month headers formatted as "Apr 2026", "May 2026", etc.
var today = new Date();
var currentMonthLabel = Utilities.formatDate(today, ss.getSpreadsheetTimeZone(), "MMM yyyy");
var headerRow = summarySheet.getRange(1, 1, 1, summarySheet.getLastColumn()).getValues()[0];
var monthColIndex = headerRow.indexOf(currentMonthLabel);
if (monthColIndex === -1) {
Logger.log("Could not find column for: " + currentMonthLabel);
return;
}
// Build the email body from the Summary tab
var data = summarySheet.getRange(2, 1, summarySheet.getLastRow() - 1, summarySheet.getLastColumn()).getValues();
var body = "Expense summary for " + currentMonthLabel + ":\n\n";
var total = 0;
for (var i = 0; i < data.length; i++) {
var category = data[i][0];
var amount = data[i][monthColIndex];
if (category && typeof amount === "number" && amount > 0) {
body += category + ": $" + amount.toFixed(2) + "\n";
total += amount;
}
}
body += "\nTotal: $" + total.toFixed(2);
body += "\n\nSent automatically from Google Sheets.";
GmailApp.sendEmail(recipientEmail, "Weekly Expense Summary — " + currentMonthLabel, body);
Logger.log("Expense summary sent.");
}One important note: the script looks for a column header that matches the current month name exactly (e.g., "Apr 2026"). Your Summary tab's month headers need to match that format. If you used a different format like "April 2026" or "04/2026," either update your headers to match "Apr 2026" or change the "MMM yyyy" format string in the script.
To schedule this to run every Monday morning:
- Click the clock icon (Triggers) in the Apps Script editor
- Click + Add Trigger
- Set function to
sendWeeklyExpenseSummary, event source to Time-driven, type to Week timer, day to Monday, time to 7am–8am - Click Save and authorize when prompted
---
Common Problems
The SUMIFS formula returns 0 when there should be totals. Usually a date format issue. Check that the dates in your Log tab are real dates (right-aligned in the cell) rather than text (left-aligned). Select the Date column, go to Format > Number > Date, and confirm the dates reformat. If they don't change, they're stored as text — retype them or use =DATEVALUE(A2) to convert.
The category totals don't match what I expect. Check for typos in your category entries in the Log tab. SUMIFS is case-insensitive but not typo-insensitive. "Office Supplies" and "Office Supply" are different. Using a dropdown (Step 2) prevents this.
The script can't find the current month column. Your Summary tab's month headers don't match the "Apr 2026" format the script expects. Either adjust your headers or update the "MMM yyyy" format string in the script to match your format. For example, for "April 2026" use "MMMM yyyy".
---
What You Have Now
- A log tab where every expense is recorded with date, amount, category, and description
- A summary tab that automatically breaks spending down by category and month
- A running current-month total that updates as you log expenses
- Optional: a weekly email summary sent every Monday
No manual filtering. No copying numbers between tabs.
---
What to Build on Top of This
- Add a budget column to the Summary tab next to each category. Use a formula to calculate variance:
=budget - actual. Highlight cells where actual exceeds budget using conditional formatting. (How to Highlight Rows in Google Sheets) - Connect to a Google Form for quick expense logging from your phone. Form responses feed directly into the Log tab. (How to Automatically Create Documents from Google Form Responses)
- Add a quarterly or annual summary by extending the SUMIFS pattern with larger date ranges.
Don't want to set this up yourself? Describe your expense categories and what summary you need, and it'll be configured for your sheet. Get it installed