Transaction Categorisation Rules That Survive Next Month

A rule written against one statement usually breaks on the next one. Writing rules against the stable part of a description is what makes them last.

5 min read


You correct a transaction's category, tell the software to remember it, and next month the same payment arrives uncategorised again.

The rule did not fail. It matched exactly what you told it to match — and the bank never printed that string twice.

What a bank description is actually made of

A description looks like one thing and is really two, spliced together:

POS PURCHASE TERMINAL 24349201 WAL-MART #3492 WICHITA KS
│              │        │        │            │
│              │        │        │            └─ location (varies)
│              │        │        └─ merchant (STABLE)
│              │        └─ store number (varies)
│              └─ terminal ID (varies every transaction)
└─ transaction type (stable)

The merchant name is stable. Nearly everything around it is not. Terminal IDs change per till, store numbers per branch, references per payment, and many banks embed the date or an authorisation code.

A rule matching the whole string matches this exact transaction and no other, ever. That is why it worked once and never again.

Write rules against the stable part

The fix is to match the fragment that identifies the merchant and ignore everything else.

Instead ofMatch on
POS PURCHASE TERMINAL 24349201 WAL-MART #3492 WICHITA KSWAL-MART
DIRECT DEBIT BRITISH GAS 8827364 REF 09/24BRITISH GAS
STRIPE PAYMENT 4471 REF 88213STRIPE
CARD PAYMENT TO AMAZON EU S.A R.L, 12.99 GBPAMAZON

Shorter is usually better, with one limit: short enough to survive variation, long enough not to catch things you did not mean. AMZ would also match AMZN MKTP and AMZ PRIME — which may be what you want, or may collapse two categories into one.

A useful test: would this rule still match if the bank changed its reference format? If not, it is matching a variable part.

The five rules that break, and how

Matching the whole string. Covered above. The most common failure by a wide margin.

Matching a reference number. REF 88213 is unique to one payment by design. Rules built from references match exactly once.

Matching an amount. "Categorise 49.99 as software" holds until the price rises to 54.99, or until a different supplier charges 49.99. Amounts are the weakest thing to key on and should generally be a secondary condition, never the only one.

Matching a date fragment. Some descriptions embed 09/24. A rule containing it expires at the end of the month, silently.

Case sensitivity. Banks are inconsistent — the same merchant appears as AMAZON, Amazon, and amazon across statements from different systems. Rules should be case-insensitive, and if yours are not, this alone explains a good share of the misses.

Rules belong to a client, not to you

PAYPAL is software for a consultancy and cost of goods for a shop. SHELL is fuel for a courier and travel expense for a solicitor. UBER is travel for one client and, for a driver, income.

A global rule applied across a practice is confidently wrong for some clients, and confidently wrong is worse than blank — a blank category gets reviewed, a wrong one gets filed.

The exception is a small set of genuinely universal patterns: HMRC, INTEREST, BANK CHARGE, the account's own fees. Everything with a merchant name in it should be scoped to the client.

Order and specificity

When two rules match, the more specific one should win.

AMAZON WEB SERVICES  →  Software        (specific)
AMAZON               →  Office supplies (general)

Without explicit ordering, an AWS invoice becomes office supplies. Two approaches work: give rules a priority and evaluate high to low, or evaluate longest pattern first, which approximates specificity without anyone maintaining numbers.

Whichever your tool does, know which — because the failure is silent and produces plausible wrong categories rather than errors.

Confidence, and what to do with the leftovers

Rules should handle the repeating majority and leave the rest alone.

A statement where 85% of transactions are categorised by rule and 15% arrive uncategorised is working correctly. The 15% is where the judgement is, and it is a review of twenty rows rather than four hundred.

Resist the urge to categorise everything automatically. A category applied confidently and wrongly costs more than a blank one, because a blank gets looked at and a wrong one gets filed, reported, and possibly submitted. The measure of a good rule set is not coverage; it is that everything it did categorise, it categorised correctly.

Build them at the point of correction

The habit that makes this work: write the rule at the moment you fix the category, not in a separate session.

At that moment you have the transaction in front of you, you know which client it belongs to, you know why the default was wrong, and you can see which part of the description is stable. A week later you have none of that, and writing rules from memory produces rules that match the wrong fragment.

Tools that offer "remember this" at the point of correction are exploiting exactly this: it is the only moment when writing a good rule is nearly free.

Reviewing the rule set

Rules accumulate and quietly rot. Twice a year is enough:

  • Rules that have not fired in six months. The merchant is gone, or the description changed and the rule is now dead. Delete or fix.
  • Rules firing on far more transactions than expected. Too general — probably swallowing something that deserves its own category.
  • Two rules with the same category and near-identical patterns. Merge.
  • Rules created for a one-off. A single transaction does not need a rule, and each one is a small ongoing cost in evaluation and confusion.

Twenty rules that fire constantly are worth more than two hundred that mostly do not — and the two hundred take longer to reason about when one of them starts doing something unexpected.

What this is worth

Categorisation is typically the largest remaining block of month-end work once transcription has been removed. Most of it repeats: the same suppliers, the same subscriptions, the same rent, every month.

Rules written against stable fragments turn that block into a review of the exceptions. Rules written against whole descriptions turn it into the same work every month, plus the maintenance of a rule set that does nothing.

The difference is a couple of minutes of thought per rule, once. How the rest of the month collapses around it.

Common questions

Why do my categorisation rules stop matching?
Because they were written against the whole description, and bank descriptions carry variable parts — terminal numbers, dates, reference codes, branch names. A rule matching only the merchant name survives; a rule matching the full string matches once.
Should categorisation be automatic or reviewed?
Automatic with review of the exceptions. Rules should handle the recurring majority silently and surface only what they could not place, because a category applied confidently and wrongly is more expensive than one left blank.