Sub topic 8
Summarize a Month and Find Your Savings Rate
A monthly summary reduces a month of transaction records to a few numbers you can compare with other months and with a plan. This chapter covers how to build one, how to compute a savings rate, and where the numbers go wrong.
Prerequisites
This chapter assumes you already have:
- Transaction records with a date, description, category, and signed amount (positive for income, negative for spending).
- A small, stable category set.
- Records that you have reconciled against your statements. A summary built on unreconciled data repeats every error in it.
- Basic Python, if you want to run the examples. The same logic works in a spreadsheet with
SUMIFS.
The working model
A monthly summary is a filter, a grouping, and three subtractions.
- Filter: keep only transactions dated inside the month.
- Remove movements that are not income or spending, such as transfers between your own accounts.
- Group by category and add up the signed amounts.
- Split the totals into income and spending.
- Calculate net cash flow and the savings rate.
The three numbers
Using the sign convention (income positive, spending negative):
- Income is the sum of all positive amounts in income categories.
- Spending is the sum of all spending-category amounts, with the sign flipped so it reads as a positive number.
- Net cash flow is income minus spending. A positive net means you took in more than you spent. A negative net means you drew down savings or borrowed.
The savings rate is net cash flow divided by income, shown as a percentage:
savings rate = (income - spending) / income x 100Income of 4,200.00 and spending of 1,848.75 gives a net of 2,351.25 and a savings rate of 56.0%.
A second figure is also useful: each category's share of spending, which is the category total divided by total spending. Shares show which categories drive your spending. The savings rate shows whether the whole system is working.
A complete summary script
The script below keeps only October 2026, sets transfers aside, and nets refunds against the original purchase in the same category. It uses Decimal, so cent amounts are exact.
import csv
from collections import defaultdict
from decimal import Decimal, ROUND_HALF_UP
from io import StringIO
data = """date,description,category,amount
2026-09-28,Grocery store,Groceries,-60.00
2026-10-01,Paycheck,Income,2100.00
2026-10-02,Rent,Housing,-1200.00
2026-10-04,Grocery store,Groceries,-86.40
2026-10-05,Car insurance,Insurance,-140.00
2026-10-06,Move to savings,Transfer,-300.00
2026-10-09,Coffee shop,Dining,-4.75
2026-10-11,Jacket,Clothing,-80.00
2026-10-12,Jacket return,Clothing,30.00
2026-10-14,Transit pass,Transportation,-85.00
2026-10-15,Paycheck,Income,2100.00
2026-10-17,Electric bill,Utilities,-92.10
2026-10-20,Grocery store,Groceries,-142.30
2026-10-24,Dinner out,Dining,-48.20
2026-11-01,Paycheck,Income,2100.00
"""
MONTH = "2026-10"
ONE_DECIMAL = Decimal("0.1")
totals = defaultdict(Decimal)
transferred = Decimal("0")
for row in csv.DictReader(StringIO(data)):
if not row["date"].startswith(MONTH):
continue
amount = Decimal(row["amount"])
if row["category"] == "Transfer":
transferred += amount
continue
totals[row["category"]] += amount
income = totals.pop("Income", Decimal("0"))
spending = -sum(totals.values(), Decimal("0"))
net = income - spending
print(f"Income: {income}")
print(f"Spending: {spending}")
print(f"Net: {net}")
if income > 0:
rate = (net / income * 100).quantize(ONE_DECIMAL, rounding=ROUND_HALF_UP)
print(f"Savings rate: {rate}%")
else:
print("Savings rate: not defined (no income this month)")
print(f"Transferred to savings: {-transferred}")
print("By category:")
for category, amount in sorted(totals.items(), key=lambda item: item[1]):
share = (-amount / spending * 100).quantize(ONE_DECIMAL, rounding=ROUND_HALF_UP)
print(f" {category:<15}{-amount:>9}{share:>7}%")Expected output:
Income: 4200.00
Spending: 1848.75
Net: 2351.25
Savings rate: 56.0%
Transferred to savings: 300.00
By category:
Housing 1200.00 64.9%
Groceries 228.70 12.4%
Insurance 140.00 7.6%
Utilities 92.10 5.0%
Transportation 85.00 4.6%
Dining 52.95 2.9%
Clothing 50.00 2.7%Some details in this script matter:
- The September grocery purchase and the November paycheck are ignored because of the month filter. Filtering on the
YYYY-MMprefix works for ISO dates (YYYY-MM-DD) and fails for any other date format. This is one reason to record dates in ISO form. - The jacket return is a positive amount in
Clothing. Netting it there makes Clothing 50.00 instead of showing 80.00 of spending and 30.00 of phantom income. - The
Transferrows never reachtotals, so they affect neither income nor spending. - The category shares add up to 100.1% because each one is rounded. That is normal. Do not "fix" it by adjusting a value.
Edge cases that change the result
| Situation | Correct treatment | What goes wrong otherwise |
|---|---|---|
| Transfer between your own accounts | Exclude from income and spending | Income and spending both inflate, and the savings rate is distorted |
| Credit card payment from checking | Exclude if you record each card purchase separately | Each purchase is counted twice |
| Refund or return | Record in the original spending category | Income is overstated and the category looks larger than it was |
| Reimbursed expense | Record the reimbursement as a positive amount in the expense's category | Income is overstated |
| Tax refund or gift | Income, but note it as one-off | A single month's savings rate looks unrealistically good |
| Month with no income | Report "not defined" | Division by zero, or a meaningless rate |
| Purchase on the last day of the month, posted next month | Pick one date rule (transaction date or posting date) and keep to it | Months disagree with statements |
What counts as "saved"
The definition above counts everything you did not spend. Net cash flow of 2,351.25 does not mean 2,351.25 ended up in a savings account. In the example, only 300.00 was transferred. The rest is still in checking, where it might be earmarked for something or might disappear into untracked cash spending.
You can report two related figures:
- The savings rate from net cash flow (56.0%) measures what you could save.
- The transferred share, 300.00 / 4,200.00 = 7.1%, measures what you actually moved.
A large gap between the two is worth investigating. It usually means a bill is due soon, there is untracked spending, or you have not yet decided what the surplus is for. Reconciliation (the previous chapter) is how you find out which.
Irregular costs distort a single month
A single month can mislead when an annual cost lands in it. Suppose a 600.00 insurance premium falls in October. Spending jumps, the savings rate drops, and nothing about your habits has changed. There are two common ways to handle this:
- Report the month as it happened, and label the one-off cost beside the summary.
- Divide the annual cost by 12 and set that amount aside each month, so the monthly summary includes a smoothed 50.00. This only works if you actually move the money into a separate account or sub-category.
The first method matches your bank statements. The second matches how your budget should look. Either is fine as long as you do not mix them within one month.
Checking the summary before you trust it
Run these checks every time:
- Sign check: the income total should be positive and the net should equal the sum of all signed amounts, apart from transfers. In the example, 4,200.00 - 1,848.75 = 2,351.25.
- Completeness check: the summary should use every transaction in the month, and the number of rows used plus the number set aside should equal the number of rows in the month.
- Category check: the category totals should add up to total spending. If you have an "Uncategorized" bucket, it should be small. Treat a large one as unfinished work.
- Reasonableness check: compare each category with last month. A 10x change is usually a data entry error, such as a misplaced decimal point.
Exercise
A month's records show income of 3,000.00, spending of 2,400.00, and a 500.00 transfer to a savings account that was entered as a spending row in the category "Savings". What are the savings rate as the records would report it and the correct savings rate, and why do they differ?
Show answer
As recorded, spending is 2,900.00 (2,400.00 plus the 500.00 "Savings" row), so net is 100.00 and the savings rate is 100 / 3,000 = 3.3%. Correctly, the transfer is excluded, so net is 600.00 and the savings rate is 600 / 3,000 = 20.0%. The two differ because a transfer between your own accounts is not spending. Treating it as spending hides the money you saved.
Exercise
Your income this month is 0.00 because you were between jobs, and your spending is 1,500.00. Why does the script print "not defined" instead of a savings rate, and what should you look at instead?
Show answer
The savings rate is net divided by income, and dividing by zero has no meaning. (A rate of minus infinity would not help anyone.) Look at net cash flow, which is -1,500.00, and at how many months of spending your savings cover. For months with very low or irregular income, a rate averaged over several months is more informative than any single month's rate.
Exercise
The category shares in your summary add up to 100.1%. Is the summary wrong, and what should you do?
Show answer
No. Each share is rounded to one decimal place on its own, so the rounded values can add up to slightly more or less than 100%. Leave the values as they are, or show shares with more decimal places if the discrepancy bothers you. Check that the category totals sum to total spending in cents, because that is where an actual error would appear.