Categorize bank statements with keyword lookup rules

Turn raw, messy bank transactions into organized expense categories using an automated keyword matching formula.

Text prompt for ChatGPT and Claude

You get: Keyword Rule Table, formula for Excel and formula for Google Sheets

Prompt

Prompt
Act as an expert spreadsheet developer. Build an automated categorization system based on my pasted bank transaction descriptions.

Rules:
- Build a two-column keyword mapping table based on the items present in my sample data.
- Provide an exact formula for both Excel (using SEARCH/INDEX/MATCH or XLOOKUP with wildcards) and Google Sheets to assign categories automatically.
- Include a fallback label of "Uncategorized" for items that fail to match.
- Suggest 2 common bank edge cases (like PayPal or Square merchant strings) and how to handle them.

Output format:
1. Keyword Rule Table (Keyword, Category)
2. Formula for Excel
3. Formula for Google Sheets
4. Handling Edge Cases & Next Actions

My bank descriptions are below:

Example output

Keyword rules and the category each assignsRules tab: keyword in column A, category in column B
ItemKeywordCategory
Rule 1UBERTravel: Rideshare
Rule 2SHELLAuto: Fuel
Rule 3AWSSoftware & Hosting
Rule 4DELTATravel: Flights
Rule 5STARBUCKSMeals & Entertainment

Example for: 5 raw transaction lines including Uber, Shell Oil, Amazon AWS, Delta, and Starbucks

1. Keyword Rule Table

Set this up on a reference tab named Rules in columns A and B:

  • A2: UBER | B2: Travel: Rideshare
  • A3: SHELL | B3: Auto: Fuel
  • A4: AWS | B4: Software & Hosting
  • A5: DELTA | B5: Travel: Flights
  • A6: STARBUCKS | B6: Meals & Entertainment
2. Formula for Excel

Assuming your raw transaction text is in cell A2 of your transactions tab, and your rules are in Rules!$A$2:$B$6:
=IFERROR(INDEX(Rules!$B$2:$B$6, MATCH(TRUE, ISNUMBER(SEARCH(Rules!$A$2:$A$6, A2)), 0)), "Uncategorized")
(In older Excel versions, press Ctrl+Shift+Enter).

3. Formula for Google Sheets

Place this in cell B2 next to raw text in A2:
=IFERROR(INDEX(Rules!$B$2:$B$6, MATCH(TRUE, ARRAYFORMULA(ISNUMBER(REGEXMATCH(A2, "(?i)" & Rules!$A$2:$A$6))), 0)), "Uncategorized")

4. Handling Edge Cases & Next Actions
  • Aggregator services: Descriptions starting with SQ * or PAYPAL * mask the actual vendor. Add the vendor's unique secondary name into column A (e.g., LOCAL ROASTER instead of SQUARE).
  • Ambiguous merchants: Stores like AMAZON can be Office Supplies, Tech, or Inventory. Use a distinct fallback tag such as Review: Amazon so you can manually assign them during reconciliations.
Written by AI from this prompt. Your results will vary.

Paste your messy bank transaction descriptions right after this prompt in ChatGPT, Claude, or Gemini. Ask a follow-up like "How do I make the formula case-insensitive?" if needed.

Reuse it: Use in a workflowTurn into a skillAdapt in the builder

Excel & Spreadsheets

Clean phone numbers and postal codes using Excel formulas

Transform irregular contact details into uniform formats for clean CRM imports. Use this whenever raw exports mix dashes, dots, spaces, or leading zeroes.

Excel & Spreadsheets

Parse Unstructured Text into Clean Excel Columns

This prompt generates specific Excel formulas to split messy text strings into organized columns while handling edge cases like missing delimiters.

Excel & Spreadsheets

Pick XLOOKUP, VLOOKUP or INDEX MATCH and Get the Exact Formula

You get one recommended lookup method for your Excel version and data layout, a paste-ready formula, and clear handling for values that have no match.

Excel & Spreadsheets

Build a 3D sum formula across multiple monthly tabs

Create a reliable 3D formula to aggregate identical cell references across multiple monthly worksheets into a single summary sheet.

Excel & Spreadsheets

Fix divide-by-zero errors in Excel variance formulas

Eliminate #DIV/0! errors in budget variance calculations with clean, professional handling for zero or missing values.

Excel & Spreadsheets

Handle cost and revenue variance signs in Excel

Standardize variance calculations across mixed revenue and expense lines so favorable outcomes consistently display correctly.