# An expense tracker in Google Sheets that sorts and totals itself

[Español](https://pushbuild.com/es/free/scripts/expense-tracker-categories/) · [Português](https://pushbuild.com/pt/free/scripts/expense-tracker-categories/) · [Deutsch](https://pushbuild.com/de/free/scripts/expense-tracker-categories/) · [Français](https://pushbuild.com/fr/free/scripts/expense-tracker-categories/)

**Short answer:** Use a free Google Apps Script that puts each expense into a category from your own keyword rules and builds a table of totals by month and category. It runs in your own Google account; nothing is sent to us. Setup takes 5 steps: Make an Expenses tab; Write your rules; Paste the script; Sort and total; Read the totals.

## How to set it up

1. **Make an Expenses tab.** Add a tab called Expenses with these columns from A to D: Date, Description, Amount, Category. Paste in rows from your bank or card export, or type them.
2. **Write your rules.** Add a tab called Rules with two columns: Keyword and Category, such as shell, Fuel and home depot, Materials. Capital letters don't matter.
3. **Paste the script.** Open Extensions, then Apps Script, paste in the code from our email, and save. Reload the sheet and a **Expenses** menu appears.
4. **Sort and total.** Choose **Expenses**, then **Categorise and total**, or **Do it every night**. A blank Category gets the first rule whose keyword is in the description; anything no rule matches is marked Review.
5. **Read the totals.** The Monthly totals tab shows one row per month with a column per category and a total. Categories you typed yourself are kept and counted.

Setup, step by step: 5 steps, done in your own Google account.

[Want this set up for your business? Free written scope in 20 minutes](https://pushbuild.com/scope.html?topic=Set%20up%3A%20An%20expense%20tracker%20in%20Google%20Sheets%20that%20sorts%20and%20totals%20itself)

## Get the script

### Download it free

We'll email you the script (`Code.gs`). It runs in your own Google account; nothing is sent to us.

### Have us install it for you

We set it up in your own Google account for you and check that it runs.

[Have us install it](https://pushbuild.com/services/workflow-automation.html?need=snippet-install:expense-tracker-categories#contact)

## Good to know

- Rules are checked from the top, so put more specific keywords above general ones.
- Rows need a real date and a number in Amount to be counted in the totals.

## Questions

**What does this script do?**

It is a free Google Apps Script that puts each expense into a category from your own keyword rules and builds a table of totals by month and category.

**How do I set it up?**

In 5 steps: 1. Make an Expenses tab; 2. Write your rules; 3. Paste the script; 4. Sort and total; 5. Read the totals. The full steps are on this page.

**Is it free, and does it send my data anywhere?**

It is free: enter your email on this page and we email you the script (`Code.gs`). It runs in your own Google account; nothing is sent to us.

**Can you install it for me?**

Yes. We set it up in your own Google account for you and check that it runs.

Want it wired into QuickBooks, your CRM or your payment system? [Send us a short brief](https://pushbuild.com/services/accounting-crm-integrations.html#contact).

**Pushbuild** · Automate your business with Pushbuild: [pushbuild.com/contact](https://pushbuild.com/contact)

---
As of 2026-11-23. Source: https://pushbuild.com/free/scripts/expense-tracker-categories/
