Sub topic 9
Compare actual spending with a budget
A budget is a plan. Your transaction records show what happened. This chapter covers how to compare the two so the comparison tells you what to change, instead of producing a long list of small differences.
Prerequisites. This chapter assumes you already record transactions with a sign convention (income positive, spending negative) and assign each one a category. It also assumes your records are reconciled against statements and that you can produce category totals for a month. If you can't, finish those chapters first, because a comparison built on unreconciled or miscategorized data produces misleading differences.
The working model
A budget comparison has three inputs and one output.
- Budget: the amount you planned for each category for one period, usually a month.
- Actual: the total of your reconciled transactions for the same category and the same period.
- Variance: the difference between them.
Your transaction records store spending as negative numbers. For a comparison, convert spending totals to positive amounts, so "budget 400, actual 462" reads naturally as "spent 462 of 400".
Choose one variance sign and keep it
For spending categories, define variance as budget minus actual.
- A positive variance means you spent less than planned (under budget).
- A negative variance means you spent more than planned (over budget).
Pick this convention once and use it everywhere. Mixing "actual minus budget" in one column with "budget minus actual" in another is a common source of wrong conclusions. For income categories the logic reverses: earning more than planned is good. The simplest fix is to compare income and spending in separate sections, each labeled with what a positive number means.
| Section | Variance formula | Positive means |
|---|---|---|
| Spending | budget - actual | Under budget |
| Income | actual - budget | Earned more than planned |
Absolute and percent variance
Report two numbers for each category.
- Absolute variance is the amount in currency, for example -62.35. It shows how much money is involved.
- Percent variance is variance divided by budget, for example -15.6%. It shows how large the miss is relative to the plan.
Neither is enough alone. Being 40% over on a 20.00 category costs 8.00, which rarely matters. Being 3% over on a 1,200.00 category costs 36.00, which might. Using both lets you filter out noise.
The comparison workflow
The steps below produce a comparison you can trust.
The most important step is the join. Take the union of categories from both sources, not only the categories that appear in the budget. Spending in a category with no budget line, such as a pharmacy purchase you never planned for, is exactly the kind of difference you need to see.
A worked example in Python
The script below joins a budget and a set of actual totals, calculates both variances, and flags categories that are large in amount and in percent. It uses Decimal so cents are exact.
from decimal import Decimal
budget = {
"Housing": Decimal("1200.00"),
"Groceries": Decimal("400.00"),
"Dining": Decimal("120.00"),
"Utilities": Decimal("150.00"),
"Transport": Decimal("90.00"),
}
actual = {
"Housing": Decimal("1200.00"),
"Groceries": Decimal("462.35"),
"Dining": Decimal("151.20"),
"Utilities": Decimal("92.10"),
"Transport": Decimal("75.50"),
"Pharmacy": Decimal("38.00"),
}
MIN_AMOUNT = Decimal("25.00")
MIN_PERCENT = Decimal("10")
rows = []
for category in sorted(set(budget) | set(actual)):
planned = budget.get(category, Decimal("0"))
spent = actual.get(category, Decimal("0"))
variance = planned - spent
percent = variance / planned * 100 if planned else None
rows.append((category, planned, spent, variance, percent))
rows.sort(key=lambda r: abs(r[3]), reverse=True)
print(f"{'Category':<10}{'Budget':>10}{'Actual':>10}{'Variance':>10}{'Pct':>8} Flag")
for category, planned, spent, variance, percent in rows:
big_amount = abs(variance) >= MIN_AMOUNT
big_percent = percent is None or abs(percent) >= MIN_PERCENT
flag = "REVIEW" if big_amount and big_percent else ""
pct_text = "n/a" if percent is None else f"{percent:.1f}%"
print(f"{category:<10}{planned:>10.2f}{spent:>10.2f}{variance:>10.2f}{pct_text:>8} {flag}")
total_planned = sum(budget.values())
total_spent = sum(actual.values())
print(f"{'Total':<10}{total_planned:>10.2f}{total_spent:>10.2f}{total_planned - total_spent:>10.2f}")Running it prints:
Category Budget Actual Variance Pct Flag
Groceries 400.00 462.35 -62.35 -15.6% REVIEW
Utilities 150.00 92.10 57.90 38.6% REVIEW
Pharmacy 0.00 38.00 -38.00 n/a REVIEW
Dining 120.00 151.20 -31.20 -26.0% REVIEW
Transport 90.00 75.50 14.50 16.1%
Housing 1200.00 1200.00 0.00 0.0%
Total 1960.00 2019.15 -59.15Reading the result
The total is only 59.15 over budget, about 3.0%. Taken alone, that looks fine. The category rows show more, because the total hides offsetting differences.
- Groceries is 62.35 over, and Dining is 31.20 over. Together that is 93.55 of food overspending.
- Utilities is 57.90 under, which covers most of the overspending in the total. That saving may not repeat. The electric bill varies by season.
- Pharmacy has no budget line, so its percent is undefined. It appears because the join used both sets of categories.
- Transport is 16.1% under but only 14.50 in amount, so it is not flagged.
The sort order uses absolute variance, so the largest money differences appear first. This is where you begin the investigation.
Why the totals mislead
The overall total and the category rows answer different questions. The total tells you whether your plan worked in aggregate. The rows tell you where it failed. Always read the rows before the total.
A category can also be on budget by coincidence. If Dining is 120.00 on plan but you replaced three planned restaurant meals with one expensive dinner, the number matches while the behavior has changed. Looking at individual transactions in a large or surprising category is part of the investigation.
Using expense types to interpret differences
The kind of expense determines what a variance means and what you can do about it.
| Expense type | Typical variance | Reasonable response |
|---|---|---|
| Fixed (rent, insurance) | Near zero, or a step change when a price changes | Update the budget to the new amount |
| Variable (groceries, fuel) | Small swings in both directions | Look for a pattern over several months before acting |
| Irregular (car repair, annual fees) | Large positive variance in most months, then a large negative one | Budget a monthly amount into a set-aside, not a one-month spike |
A fixed expense that shows variance usually means a price changed or a transaction was miscategorized. Investigate those first because they are quick to fix. A variable expense deserves a decision only when the same direction repeats. An irregular expense needs a structural fix. If your yearly car insurance is 600.00, put 50.00 per month in the budget and track the set-aside, so the single payment month does not look like a failure.
Common errors
- Comparing before reconciling. A missing or duplicated transaction creates a variance that is not real. Reconcile first.
- Comparing partial months. On day 15, a category at 50% of budget is on pace, not under budget. Compare partial months against the budget scaled to the days elapsed, or wait for the month to close.
- Period mismatch. Budgeting by calendar month while some bills post on the 31st can shift a payment into the next month. Use the transaction date consistently, as you did in your records.
- Category drift. If you rename or split categories mid-year, last month's actuals no longer match this month's budget lines. Change categories only at the start of a period and note the change.
- Budget lines that never change. If a category misses by the same amount for four months, the plan is wrong, not your behavior. Revise the budget to a realistic figure, then decide separately whether you want to spend less.
- Treating every variance as a failure. Under-spending is not automatically good. A skipped medical visit or deferred maintenance shows as a favorable variance and may cost more later.
Acting on the differences
Once you have a short list of flagged categories, write one sentence for each that names the cause and the decision. For example:
- Groceries over by 62.35: two large stock-up trips for a guest visit. One-off. No change.
- Dining over by 31.20: third month in a row. Raise the budget to 150.00 and reduce Transport by 30.00.
- Pharmacy 38.00 unbudgeted: add a 30.00 line for next month.
Notes like these turn a table of numbers into a record you can reread in a later month. They also feed the trend analysis you will do across several months.
Exercise
Your budget for Dining is 150.00 and your actual spending was 171.00. Using "budget minus actual", what are the absolute and percent variances, and how do you read them? Then say what you would do if Dining has been over by about the same amount for four months.
Show answer
Absolute variance is 150.00 - 171.00 = -21.00. Percent variance is -21.00 / 150.00 = -14.0%. The negative sign means you spent more than planned, by 21.00 or 14.0% of the budget. Whether it is flagged depends on your thresholds. With the thresholds used in this chapter (25.00 and 10%) it would not be flagged, because the amount is under 25.00. If the same overage has repeated for four months, the budget is probably unrealistic. Raise the Dining line to about 170.00 and offset it from another category, or decide deliberately to cut the spending.
Exercise
A month's comparison shows a total variance of +5.00 (under budget), but Groceries is -80.00 and Utilities is +85.00. Why should you not conclude that the month went to plan, and what would you check?
Show answer
The total hides offsetting differences. Groceries is over budget by 80.00, which may signal a habit or a one-off cost. Utilities is under by 85.00, which may be seasonal or a timing effect, such as a bill that posts next month. Check the individual Groceries transactions to see whether the overage will repeat. Check whether the Utilities bill was delayed or the category was miscategorized. Then decide whether either budget line should change.